lolas

JavaScript performance comparison

Test case created by safasf

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="add"></div>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
test1
var p = [];
for (var i = 0, x = 1000; i<x; i+=1) {
p.push(i);
}
for (var i = 0, x = p.length; i<x; i+=1) {
console.log(i);
}
pending…
test2
var p = [];
for (var i = 0, x; x= 1000; i += 1) {
 p.push(i);
}
//Better
for (var i = 0, x; x= p[i]; i += 1) {
 console.log(i);
}
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