Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Qqqqqqq
(version: 0)
Comparing performance of:
1 vs 2
Created:
9 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var as = []; var as2 = []; (function () { function A() { this.x = Math.random(); } A.prototype.y = function (){}; A.prototype.z = function (){}; for (var i = 0; i < 15; ++i) { var a = new A(); as.push(a); if (a.x < 0.5) { as2.push(a); } } })();
Tests:
1
function f1 (run) { for (var i = 0; i < as.length; ++i) { if (run && as2.indexOf(as[1]) === -1) { as[i].y(); } else { as[i].z(); } } as = run ? as2 : as; }; f1(false); f1(true);
2
function f2 (run) { if (run) { for (var i = 0; i < as.length; ++i) { if (as2.indexOf(as[1]) === -1) { as[i].y(); } } as = as2; } for (var i = 0; i < as.length; ++i) { as[i].z(); } }; f2(false); f2(true);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Qqqqqq
Qqqqqqqq
Qqqqqqqqq
test124578
Comments
Confirm delete:
Do you really want to delete benchmark?