parse Str 2 Num: Number() vs parseInt() vs plus vs bitwise vs Math.* vs JSON (v65)

Revision 65 of this benchmark created by BananaAcid on


Test runner

Ready to run.

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

Revisions

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