Map vs IterableMap
JavaScript performance comparison
Preparation code
<script>
function IterableMap() {
this._internal = new Map();
this._keys = new Array(100);
this.size = 0;
this.has = Map.prototype.has.bind(this._internal);
this.set = Map.prototype.has.bind(this._internal);
this.get = Map.prototype.has.bind(this._internal);
}
</script>
<script>
Benchmark.prototype.setup = function() {
var keys = [
1,
{},
[],
"1"
];
var m1 = new Map();
var m2 = new IterableMap();
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Map |
|
pending… |
IterableMap |
|
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
- Revision 2: published
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
- Revision 9: published
- Revision 10: published
- Revision 11: published
- Revision 12: published
- Revision 13: published
- Revision 14: published
- Revision 15: published
- Revision 16: published
- Revision 17: published
0 comments