JS Floors (v3)

Revision 3 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 left shift
r = 9.5<<0
ready
Bitwise right shift
r = 9.5>>0
ready
Bitwise right shift (unsigned)
r = 9.5>>>0
ready

Revisions

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