Number() vs parseInt() vs plus vs bitwise (v43)

Revision 43 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor
var foo = "100";
Number(foo);
ready
parseInt
var foo = "100";
parseInt(foo, 10);
ready
Plus operator
var foo = "100";
+foo;
ready
Bitwise >> (right shift)
var foo = "100";
foo >> 0;
ready
Multiply (force cast)
var foo = "100";
foo * 1;
ready
not not
var foo = "100";
~~foo;
ready
Parse Float
var foo = "100";
parseFloat(foo);
ready
|
var foo = "100";
foo | 0;
ready

Revisions

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