performance of parseInt()

JavaScript performance comparison

Revision 19 of this test case created

Preparation code

 
<script>
Benchmark.prototype.teardown = function() {
    var x = '008';
};
</script>

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(x)
pending…
parseInt(x, 10)
parseInt(x, 10)
pending…
+x
+x
pending…
~~x
~~x
pending…
parseFloat(x)
parseFloat(x)
pending…
Number(x)
Number(x)
pending…
x*1
x*1
pending…
Math.floor(x)
Math.floor(x)
pending…
Math.ceil(x)
Math.ceil(x)
pending…
Math.round()
Math.round(x)
pending…
x-0
x-0
pending…
x-0.0
x-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