Math.floor vs bitwise

Benchmark created by Paul Grenier on


Test runner

Ready to run.

Testing in
TestOps/sec
a
for (i = -10; i < 10; i += .01) {
  i>0?~~i:i==~~i?i:~~i-1;
}
ready
b
for (i = -10; i < 10; i += .01) {
  Math.floor(i);
}
ready

Revisions

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

  • Revision 1: published by Paul Grenier on