repo.or.cz
/
qtwebkit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Update ReadMe.md
[qtwebkit.git]
/
JSTests
/
microbenchmarks
/
has-own-property-name-cache.js
blob
8f6f071c0bf621522794def5ba4649abcbc86c79
1
let objs = [
2
{
3
__proto__: {
4
foo: 25
5
},
6
bar: 50,
7
baz: 75,
8
jaz: 80,
9
},
10
{
11
__proto__: {
12
bar: 25
13
},
14
baz: 75,
15
kaz: 80,
16
bar: 50,
17
jaz: 80,
18
},
19
{
20
__proto__: {
21
bar: 25,
22
jaz: 50
23
},
24
bar: 50,
25
baz: 75,
26
kaz: 80,
27
jaz: 80,
28
foo: 55
29
}
30
];
31
32
function foo(o) {
33
for (let p in o)
34
o.hasOwnProperty(p);
35
36
}
37
noInline(foo);
38
39
let start = Date.now();
40
for (let i = 0; i < 1000000; ++i) {
41
foo(objs[i % objs.length]);
42
}
43
const verbose = false;
44
if (verbose)
45
print(Date.now() - start);