perf for in loop vs pre enum keys for loop
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
function createTestData(count) {
var rv = {}, i = 0;
for (; i < count; ++i) {
rv[i] = i;
}
return rv;
}
window.testData = createTestData(200);
Object.prototype.oreore1 = "oreore1";
Object.prototype.oreore2 = "oreore2";
Object.prototype.oreore3 = "oreore3";
Object.prototype.oreore4 = "oreore4";
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
for in loop |
|
pending… |
uupaa looper |
|
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:
- Revision 1: published by uupaa
- Revision 2: published by kyo_ago
- Revision 3: published by azu
- Revision 4: published by uupaa
0 comments