diff options
Diffstat (limited to 'tests/benchmarks/declarative/script/data')
10 files changed, 119 insertions, 0 deletions
diff --git a/tests/benchmarks/declarative/script/data/CustomObject.qml b/tests/benchmarks/declarative/script/data/CustomObject.qml new file mode 100644 index 0000000..22b7be7 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/CustomObject.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +QtObject { + property real prop1: 0 + property real prop2: 1 + property real prop3: 0 +} diff --git a/tests/benchmarks/declarative/script/data/block.qml b/tests/benchmarks/declarative/script/data/block.qml new file mode 100644 index 0000000..bb03d8d --- /dev/null +++ b/tests/benchmarks/declarative/script/data/block.qml @@ -0,0 +1,34 @@ +import Qt 4.6 + +Rectangle { + width: 200; height: 200 + CustomObject { id: theObject } + function doSomethingDirect() { + theObject.prop1 = 0; + + for (var i = 0; i < 60; ++i) + theObject.prop1 += theObject.prop2; + + theObject.prop3 = theObject.prop1; + } + + function doSomethingLocalObj() { + theObject.prop1 = 0; + + var incrementObj = theObject; + for (var i = 0; i < 60; ++i) + incrementObj.prop1 += incrementObj.prop2; + + incrementObj.prop3 = incrementObj.prop1; + } + + function doSomethingLocal() { + theObject.prop1 = 0; + + var increment = theObject.prop2; + for (var i = 0; i < 60; ++i) + theObject.prop1 += increment; + + theObject.prop3 = theObject.prop1; + } +} diff --git a/tests/benchmarks/declarative/script/data/signal_args.qml b/tests/benchmarks/declarative/script/data/signal_args.qml new file mode 100644 index 0000000..f02acc0 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/signal_args.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +TestObject { + onMySignalWithArgs: { var a = n; return a; } +} + diff --git a/tests/benchmarks/declarative/script/data/signal_qml.qml b/tests/benchmarks/declarative/script/data/signal_qml.qml new file mode 100644 index 0000000..ba53603 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/signal_qml.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +TestObject { + onMySignal: { var a = 1; return a; } +} + diff --git a/tests/benchmarks/declarative/script/data/signal_unconnected.qml b/tests/benchmarks/declarative/script/data/signal_unconnected.qml new file mode 100644 index 0000000..53d06d5 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/signal_unconnected.qml @@ -0,0 +1,4 @@ +import Qt.test 1.0 + +TestObject { +} diff --git a/tests/benchmarks/declarative/script/data/signal_unusedArgs.qml b/tests/benchmarks/declarative/script/data/signal_unusedArgs.qml new file mode 100644 index 0000000..3ff9071 --- /dev/null +++ b/tests/benchmarks/declarative/script/data/signal_unusedArgs.qml @@ -0,0 +1,6 @@ +import Qt.test 1.0 + +TestObject { + onMySignalWithArgs: { var a = 1; return a; } +} + 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(); } } +} + |