aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/js/fib10.qml
blob: 7e0df4fb9efdd4239a271070ca6e8a82d9e8181c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
    }
}