Number() vs parseInt() vs plus vs bitwise (v7)

Revision 7 of this benchmark created by David Hammond on


Test runner

Ready to run.

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

Revisions

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