objdir
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var range = function(min, max, diff) {
"use strict";
var returnList = [];
i = min;
if (!diff) {
diff = 1;
}
for (; i < max; i = i + diff) {
returnList.push(i);
}
return returnList;
},
obj = {},
data = range(1, 10000),
i = 0;
for (; i < data.length; i += 1) {
obj[i] = i + 1;
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
for in |
|
pending… |
for in cached |
|
pending… |
Object prototype |
|
pending… |
Object prototype with for loop |
|
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 2: published
- Revision 6: published by Alexander Kolarski
- Revision 7: published by Tim
0 comments