diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-08 05:14:44 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-08 05:14:44 (GMT) |
commit | 7cd2c43e41e204f5662a51c72b31e0606b71def3 (patch) | |
tree | 7405e9245dc66d3da2497f1afc5e500c440cee01 /tests/benchmarks/declarative/script/data | |
parent | 7abc7b839223eaf05006fe35dceec690fee5ce3d (diff) | |
download | Qt-7cd2c43e41e204f5662a51c72b31e0606b71def3.zip Qt-7cd2c43e41e204f5662a51c72b31e0606b71def3.tar.gz Qt-7cd2c43e41e204f5662a51c72b31e0606b71def3.tar.bz2 |
QML dynamic function benchmark
Diffstat (limited to 'tests/benchmarks/declarative/script/data')
4 files changed, 56 insertions, 0 deletions
diff --git a/tests/benchmarks/declarative/script/data/slot_complex.qml b/tests/benchmarks/declarative/script/data/slot_complex.qml new file mode 100644 index 0000000..d71120d --- /dev/null +++ b/tests/benchmarks/declarative/script/data/slot_complex.qml @@ -0,0 +1,16 @@ +import Qt.test 1.0 + +TestObject { + function myCustomFunction(b) { + var n = b; + var a = 1; + while (n > 0) { + a = a * n; + n--; + } + return a; + } + + onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(10); } } +} + diff --git a/tests/benchmarks/declarative/script/data/slot_complex_js.qml b/tests/benchmarks/declarative/script/data/slot_complex_js.qml new file mode 100644 index 0000000..ed4f78b --- /dev/null +++ b/tests/benchmarks/declarative/script/data/slot_complex_js.qml @@ -0,0 +1,18 @@ +import Qt.test 1.0 + +TestObject { + Script { + function myCustomFunction(n) { + var a = 1; + while (n > 0) { + a = a * n; + n--; + } + return a; + } + } + + onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(10); } } +} + + diff --git a/tests/benchmarks/declarative/script/data/slot_simple.qml b/tests/benchmarks/declarative/script/data/slot_simple.qml new file mode 100644 index 0000000..4ba98d7 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/slot_simple.qml @@ -0,0 +1,9 @@ +import Qt.test 1.0 + +TestObject { + function myCustomFunction() { + return 0; + } + + onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(); } } +} diff --git a/tests/benchmarks/declarative/script/data/slot_simple_js.qml b/tests/benchmarks/declarative/script/data/slot_simple_js.qml new file mode 100644 index 0000000..a88265c --- /dev/null +++ b/tests/benchmarks/declarative/script/data/slot_simple_js.qml @@ -0,0 +1,13 @@ +import Qt.test 1.0 + +TestObject { + + Script { + function myCustomFunction() { + return 0; + } + } + + onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(); } } +} + |