type cast

JavaScript performance comparison

Revision 3 of this test case created by Mahdi

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
parseInt
var a = parseInt("10000000.1212", 10);
var b = parseInt("1000", 10);
pending…
Right Shift
var a = "10000000.1212" >> 0;
var b = "1000" >> 0;
pending…
Zero-fill right shift
// Doesn't work for negatives
var a = "10000000.1212" >>> 0;
var b = "1000" >>> 0;
pending…
|0 operator
var a = "10000000.1212"|0;
var b = "1000"|0;
pending…
+ operator
var a = +"10000000.1212";
var b = +"1000";
pending…
Left Shift
var a = "10000000.1212" << 0;
var b = "1000" << 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.

0 Comments