mirror of https://github.com/tc39/test262.git
28 lines
582 B
JavaScript
28 lines
582 B
JavaScript
function bar(map, p) {
|
|
return map.get(p) + map.get(p);
|
|
}
|
|
noInline(bar);
|
|
|
|
function foo() {
|
|
let map = new Map;
|
|
let items = [
|
|
[10, 50],
|
|
["450", 78],
|
|
[{}, {}],
|
|
[Symbol(), true],
|
|
[undefined, null],
|
|
[true, null],
|
|
[false, true],
|
|
[45.87, {}]
|
|
];
|
|
for (let [key, value] of items)
|
|
map.set(key, value);
|
|
let start = Date.now();
|
|
for (let i = 0; i < 5000000; i++)
|
|
bar(map, items[i % items.length][0]);
|
|
const verbose = false;
|
|
if (verbose)
|
|
print(Date.now() - start);
|
|
}
|
|
foo();
|