performance of parseInt()

JavaScript performance comparison

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