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,
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?

Interest mailing list

Reply via email to