es6-map-shim-vs-transit-map

JavaScript performance comparison

Revision 3 of this test case created by

Preparation code

<script src="https://cdn.cognitect.com/transit/transit-0.8.616-min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.11.0/es6-shim.min.js" type="text/javascript"></script>
      
<script>
Benchmark.prototype.setup = function() {
  var smallObject = {};
  for(var i = 0; i < 8; i++) {
    smallObject["foo"+i] = i;
  }
  
  var smallES6Map = new Map();
  for(var i = 0; i < 8; i++) {
    smallES6Map.set("foo"+i, i);
  }
  
  var smallTransitMap = transit.map();
  for(var i = 0; i < 8; i++) {
    smallTransitMap.set("foo"+i, i);
  }

};
</script>

Preparation code output

<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.11.0/es6-shim.min.js" type="text/javascript"></script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments