diff options
Diffstat (limited to 'src/benchmarks/auto/js/fib10.qml')
-rw-r--r-- | src/benchmarks/auto/js/fib10.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/benchmarks/auto/js/fib10.qml b/src/benchmarks/auto/js/fib10.qml new file mode 100644 index 0000000..7e0df4f --- /dev/null +++ b/src/benchmarks/auto/js/fib10.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 +import QmlBench 1.0 + +// Tests the creation of Items with a recursive function binding +CreationBenchmark { + id: root; + count: 50; + staticCount: 1000; + delegate: Item { + x: fib(10); + } + + function fib(n) { + if (n < 2) + return Math.max(0, n); + else + return fib(n-1) + fib(n-2); + } +} |