blob: fa2d35e44208f9f4f7d3ab2565651415b04592ec [file] [log] [blame]
let counter = 0;
function bar(map) {
for (let [key, value] of map) {
if (Math.random() > 0.95) {
map.set("" + counter, counter);
++counter;
}
}
}
noInline(bar);
function foo() {
let map = new Map;
for (let i = 0; i < 1000; i++)
map.set(i, i+1);
let start = Date.now();
for (let i = 0; i < 100; i++)
bar(map);
const verbose = false;
if (verbose)
print(Date.now() - start);
}
foo();