JS Floors (v2)

Revision 2 of this benchmark created on


Setup

var r, f = Math.floor;

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
r = Math.floor(9.5);
ready
Double not
r = ~~9.5
ready
Bitwise or
r = 9.5|0
ready
Cached Math.floor
r = f(9.5);
ready
Bitwise shift
r = 9.5<<0
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.