Rene Koller
Rene Koller

Reputation: 415

Benchmark.js and Bonsai.js

I'm currently testing some Visualization toolkits performance and have a problem testing bonsai.js. Every time I run the benchmark the chrome renderer crashes, and i can't seem to find the problem because bonsai.js is pretty hard to debug.

var i = 0,
    bench = new Benchmark('Bonsai',
    function() {
        var b = bonsai.run(player, {
                code: document.getElementById('bs').innerHTML,
                height: 500,
                width: 500,
                framerate: 40
            });
    },
    {
    'onStart': function() {
        console.log('Running benchmark...');
    },
    'onComplete':  function() {
        console.log('Finished benchmark');
        console.log('Ops/sec: ' + this.hz);
        console.log('Standard Deviation: ' + this.stats.deviation);
        console.log('Cycles: ' + i);
        console.log('Iterations/Cycle: ' + this.count);
    },
    'onCycle': function() {
        $('#bonsai').empty();
        i += 1;
    }
});

I've created a fiddle based on an example Visualization from the bonsai Website that illustrates the issue: http://jsfiddle.net/2uvXM/1/

I had to include benchmark.js inline because I did not find a cdn hosting a current version.

Upvotes: 1

Views: 385

Answers (0)

Related Questions