The mapPerf Namespace

.MAX_NUM_KEY {number}

Maxium number of keys in keyList (and, by extension, the map under test).

.MapType

@typedef
{goog.labs.structs.Map|goog.structs.Map}

.fillMap(map, numKeys)

Fills the given map with generated key-value pair.

map {mapPerf.MapType}
The map to fill.
numKeys {number}
The number of key-value pair to fill.

.keyList {Array}

A key list. This maps loop index to key name to be used during benchmark. This ensure that we do not need to pay the cost of string concatenation/GC whenever we derive a key from loop index. This is filled once in setUpPage and then remain unchanged for the rest of the test case.

.perfTable {goog.testing.PerformanceTable}

.primeMapWithDeletion(map)

Primes the given map with deletion of keys.

map {mapPerf.MapType}
The map to prime.
returns {mapPerf.MapType}
The primed map (for chaining).

.runPerformanceTestForMapGet(map, message)

Runs performance test for Map#get with the given map.

map {mapPerf.MapType}
The map to stress.
message {string}
Message to be put in performance table.

.runPerformanceTestForMapSet(map, message)

Runs performance test for Map#set with the given map.

map {mapPerf.MapType}
The map to stress.
message {string}
Message to be put in performance table.