Number() vs parseInt() vs plus vs bitwise (v88)

Revision 88 of this benchmark created on


Setup

var x = "102961127921";

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
+ 0 / 10
(x+0) / 10;
ready
/1
x/1;
ready
parseFloat
parseFloat(x);
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.