Fastest Number Conversion

JavaScript performance comparison

Test case created by andrew

Info

Which way is the fastest to make a string into a number

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Parse Int
var x = "08";
var y = parseInt( x, 10 );
pending…
Number
var x = "08";
var y = Number( x );
pending…
'Addition Trick'
var x = "08";
var y = +x;
pending…
'multiplication trick'
var x = "08";
var y = x*1;
pending…

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

Compare results of other browsers

0 comments

Add a comment