[Interest] QJSEngine vs. (deprecated) QScriptEngine performance - old thing winning!

Jan 'Koviš' Struhár jan.struhar at cs-soft.cz
Wed Oct 12 12:40:19 CEST 2016


On 10/12/2016 11:40 AM, Ulf Hermann wrote:
>> QJSValue result = qmlEngine.evaluate(item.m_expression.sourceCode());
>
> I guess you are mostly profiling the JIT compiling, not the actual 
> evaluation. In order to get realistic results you should keep the 
> compiled representation of the expression around, e.g. as a JS 
> function. From the docs:
>
>> QJSValue fun = myEngine.evaluate("(function(a, b) { return a + b;})");
> > QJSValueList args; args << 1 << 2;
> >QJSValue threeAgain = fun.call(QJSValue(), args); regards,
> Ulf 
The usage scenario fits my needs, that is the reason to evaluate exactly 
this way.

I mean - should the QScriptEngine be deprecated, the 
QQmlEngine/QJSEngine should also have ways to utilize some form of 
JIT/preparse. Even in the first pass where JIT cannot be effective (or 
when I parse just the text expression) QScriptEngine beats newer and 
more shiny QJSEngine a lot. That is confusing to me and my point - why 
is QJSEngine offered as replacement of QScriptEngine when it is so much 
slower?

Jan



More information about the Interest mailing list