Number() vs parseInt() vs plus vs bitwise (v60)

Revision 60 of this benchmark created on


Setup

var x = String("1424821476000");

Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor
Number(x);
ready
parseInt
parseInt(x);
ready
Plus operator
+x;
ready
Bitwise >> (right shift)
x >> 0;
ready
Multiply (force cast)
x * 1;
ready
Bitwise NOT
~~
x;
ready
parseInt with base argument
parseInt(x, 10);
ready
Bitwise OR
x | 0
ready
minus 0
x - 0;
ready
JSON.parse()
JSON.parse(x)
ready
parseFloat
parseFloat(x, 10)
ready
Math.floor
Math.floor(x)
ready

Revisions

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