Fibonacci sequense sum algorithms
JavaScript performance comparison
Preparation code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
var n = 60;
function _fibSum(f, s, n) {
fs = f + s;
return n-- > 2? fs + _fibSum(s, fs, n): ++fs;
};
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
recurcing function
|
|
pending… |
plain cycle
|
|
pending… |
optimized recursive
|
|
pending… |
outer function call
|
|
pending… |
one step optimized, optimized recursive
|
|
pending… |
plain while
|
|
pending… |
formula from http://milan.milanovic.org/math/english/sum/fibsum.html
|
|
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.
- Revision 1: published dmi3y
- Revision 2: published
- Revision 3: published dmi3y
- Revision 4: published
- Revision 5: published dmi3y
- Revision 6: published dmi3y
- Revision 7: published Jörg Schaper
- Revision 8: published dmi3y
0 Comments