Object string index or object index

Benchmark created by Gary Barlow on


Setup

indexMap = {
    INDEX1: {name: "index1"},
    INDEX2: {name: "index2"}
    };
    
    map = {
    hey: 1,
    hey2: 2};
    
    mapIndexed = {
    indexMap.INDEX1: 1,
    indexMap.INDEX2: 2};
    
    testVar1 = 0
    testVar2 = 0

Test runner

Ready to run.

Testing in
TestOps/sec
string map
testVar1 += map["hey"]
testVar1 += map["hey2"]
ready
object map
testVar2 += mapIndexed[indexMap.INDEX1]
testVar2 += mapIndexed[indexMap.INDEX2]
ready

Revisions

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

  • Revision 1: published by Gary Barlow on