diff options
Diffstat (limited to 'tests/benchmarks/declarative/script/data/block.qml')
-rw-r--r-- | tests/benchmarks/declarative/script/data/block.qml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/benchmarks/declarative/script/data/block.qml b/tests/benchmarks/declarative/script/data/block.qml new file mode 100644 index 0000000000..bb03d8d409 --- /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; + } +} |