Improve Julia login time
ClosedPublic

Authored by sirgienko on Jul 15 2018, 12:11 PM.

Details

Summary

Rewrite code for parsing variables and functions names and move it to server side.

Diff Detail

Repository
R55 Cantor
Branch
julia-highligt-refactor
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1051
Build 1064: arc lint + arc unit
sirgienko created this revision.Jul 15 2018, 12:11 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJul 15 2018, 12:11 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.Jul 15 2018, 12:11 PM
asemke added inline comments.Jul 16 2018, 6:30 AM
src/backends/julia/juliaserver/juliaserver.cpp
153

jl_names_function can be defined later when it's needed, after the potential "return" couple of lines below.

155

moduleName is only required if module != jl_internal_main_module. So, put this inside of the if-statement.

211

m_variables instead of m_foundVariables?

216

m_variableValues instead of m_foundVariableValues?

221

m_functions instead of m_foundFunctions?

src/backends/julia/juliasession.cpp
252

Add a sanity check for the case when values.size() != variables.size():

if (i>=values.size()) continue;
sirgienko updated this revision to Diff 37884.Jul 16 2018, 3:39 PM

Add @asemke suggesteons.

sirgienko marked 6 inline comments as done.Jul 16 2018, 3:40 PM

This doesn't compile with julia 0.4.7

/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp: In member function ‘void JuliaServer::parseJlModule(jl_module_t*)’:
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:156:55: error: ‘jl_string_ptr’ was not declared in this scope
         const QString& moduleName = QString::fromUtf8(jl_string_ptr(jl_call1(jl_string_function, (jl_value_t*)(module->name))));
                                                       ^~~~~~~~~~~~~
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:156:55: note: suggested alternative: ‘jl_string_data’
         const QString& moduleName = QString::fromUtf8(jl_string_ptr(jl_call1(jl_string_function, (jl_value_t*)(module->name))));
                                                       ^~~~~~~~~~~~~
                                                       jl_string_data
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:171:46: error: ‘jl_string_ptr’ was not declared in this scope
             QString name = QString::fromUtf8(jl_string_ptr(jl_call1(jl_string_function, data[i])));
                                              ^~~~~~~~~~~~~
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:171:46: note: suggested alternative: ‘jl_string_data’
             QString name = QString::fromUtf8(jl_string_ptr(jl_call1(jl_string_function, data[i])));
                                              ^~~~~~~~~~~~~
                                              jl_string_data
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:188:66: error: ‘jl_unionall_type’ was not declared in this scope
             else if (datetype != jl_datatype_type && datetype != jl_unionall_type)
                                                                  ^~~~~~~~~~~~~~~~
/home/alex/Projekte/cantor/src/backends/julia/juliaserver/juliaserver.cpp:188:66: note: suggested alternative: ‘jl_uniontype_type’
             else if (datetype != jl_datatype_type && datetype != jl_unionall_type)
                                                                  ^~~~~~~~~~~~~~~~
                                                                  jl_uniontype_type

Looks like we need to add additional include(s) containing the declarations of jl_string_ptr and jl_uniontype_type for 0.4.7.

sirgienko updated this revision to Diff 38178.Jul 21 2018, 2:02 PM

Add compatibility for julia 0.4.7

asemke accepted this revision.Jul 21 2018, 6:00 PM
This revision is now accepted and ready to land.Jul 21 2018, 6:00 PM
This revision was automatically updated to reflect the committed changes.