FP algo

JavaScript performance comparison

Test case created by Birukov Pavel

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function fibo(n) {
      var f = [];
      for (var c = 0; c < n; ++c) {
        f.push((c < 2) ? c : f[c-1] + f[c-2]);
      }
      return f;
    }
    function fiboF(n) {
      return Array.apply(0, {length: n})
    }
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
fibo classic
fibo(100)
pending…
fibo FP
fiboF(100)
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment