Number() vs parseInt() vs plus vs bitwise (v84)

Revision 84 of this benchmark created on


Setup

var value = Math.random() > 0.5 ? "9007199254740992" : "10";

Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor
Number(value);
ready
parseInt
parseInt(value, 10);
ready
Plus operator
+value;
ready
Bitwise >> (right shift)
value >> 0;
ready
Multiply (force cast)
value * 1;
ready
not not
~~value;
ready

Revisions

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