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

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


Hi there

Re: QScriptEngine vs. QJSEngine? 
<https://forum.qt.io/topic/23077/qscriptengine-vs-qjsengine>

I was given a task to compare performance scripting solutions in Qt and 
to my surprise QScriptEngine was the absolute winner of the contest, 
especially with the ability of keeping pre-parsed script in QScriptProgram.
The evaluation of 30.000 expressions was 3-6 *times* better on first 
evaluation round, 6-30 times on the repeated evaluation (depending on 
formulae complexity reaching from simple calculation "100 + (5/1.23)" to 
more complicated 2 line expressions with some variable bindings).

I was truly astonished that QJSEngine performed that miserably at simple 
calculations as it is the engine powering QML. Maybe 
QJSEngine-QQmlEngine is optimized toward property notifications/changes, 
maybe this performance gap is the reason why QtScript was not yet been 
phased out.
Maybe I am completely wrong in general. Anyone else experienced this?

Thank you for your insights!

Code involved is

hg clone https://kovis@bitbucket.org/kovis/qtscripting

hg clone https://kovis@bitbucket.org/kovis/qtscripting

hg up 
501e8c4264cd124fd1ec6b82670d6f947c9c2859<https://bitbucket.org/kovis/qtscripting/commits/501e8c4264cd124fd1ec6b82670d6f947c9c2859?at=default>


or here in 
https://bitbucket.org/kovis/qtscripting/commits/501e8c4264cd124fd1ec6b82670d6f947c9c2859?at=default

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161012/89a18fdc/attachment.html>


More information about the Interest mailing list