Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Wednesday, June 3, 2020

Speed Benchmark: Calling QML function versus Javascript function versus QObject

QML Function Call Performance Comparison

Is calling QML functions faster than calling Javascript functions? How about calling QObject functions? Which has speed advantage?

Note that this is merely calling functions but not running for-loops and while-loops. The intent is to compare this speed of calling Javascript functions to the speed of calling QObjects functions.

Outcome of Benchmark

Surprisingly, calling Javascript .mjs functions (referred to by Qt as ECMAScript modules, which conforms to Javascript ES7 standards) is 40% faster than calling either QML functions or old style Javascript functions.

Calling C++ QObjects from QML is 344% slower than calling another function in a native QML object!