Boot time for Map vs literal Obj hash map

JavaScript performance comparison

Test case created by gartz

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  const IdType = {
    FOO: Symbol(),
    BAR: Symbol(),
    ZAZ: Symbol()
  }

};
</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
Map
const hashmap = new Map([
  ['FOO', IdType.FOO],
  ['BAR', IdType.BAR],
  ['ZAZ', IdType.ZAZ],
])
pending…
Literal Object
const hashmap = {
  FOO: IdType.FOO,
  BAR: IdType.BAR,
  ZAZ: IdType.ZAZ,
}
pending…

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

0 Comments