performance of parseInt() (v33)

Revision 33 of this benchmark created by Rob Adams on


Description

Side note on big numbers (32-bit or bigger)

The result of binary operations are signed 32-bit numbers. Standard ECMA-262 5.1

  • 11.7 Binary shift operators
  • 11.10 Binary bitwise operators

Test runner

Ready to run.

Testing in
TestOps/sec
parseInt(x)
parseInt('4px')
ready
parseInt(x, 10)
parseInt('4px', 10)
ready
+x
+('4px').slice(0, -2)
ready
~~x
~~
('4px').slice(0, -2)
ready
x >> 0
('4px').slice(0, -2) >> 0
ready
x >>> 0
('4px').slice(0, -2) >>> 0
ready
x - 0
('4px').slice(0, -2) - 0
ready
x * 1
('4px').slice(0, -2) * 1
ready

Revisions

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