JS Floors
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var r, f = Math.floor;
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Math.floor |
|
pending… |
Double not |
|
pending… |
Bitwise or |
|
pending… |
Cached Math.floor |
|
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:
- Revision 1: published by Josh
- Revision 2: published
- Revision 3: published
1 comment
Why does Math.floor outperform the cached Math.floor in chrome?