performance of parseInt()

JavaScript performance comparison

Revision 6 of this test case created

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('4')
pending…
parseInt(x, 10)
parseInt('4', 10)
pending…
+x
+'4'
pending…
~~x
~~'4'
pending…
parseFloat(x)
parseFloat('4')
pending…
Number(x)
Number('4')
pending…
new Number(x)
// Please note that new primitives are dangerous
new Number('4')
pending…
Math.floor(x)
Math.floor('4')
pending…
Math.ceil(x)
Math.ceil('4')
pending…
Math.round()
Math.round('4')
pending…
x-0
'4'-0
pending…
x-0.0
'4'-0.0
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