performance of parseInt()

JavaScript performance comparison

Revision 33 of this test case created by Rob Adams

Info

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

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

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
parseInt(x)
parseInt('4px')
pending…
parseInt(x, 10)
parseInt('4px', 10)
pending…
+x
+('4px').slice(0, -2)
pending…
~~x
~~
('4px').slice(0, -2)
pending…
x >> 0
('4px').slice(0, -2) >> 0
pending…
x >>> 0
('4px').slice(0, -2) >>> 0
pending…
x - 0
('4px').slice(0, -2) - 0
pending…
x * 1
('4px').slice(0, -2) * 1
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment