<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Unite op_get_by_id_with_this with op_get_by_id"
href="https://bugs.webkit.org/show_bug.cgi?id=162124#c15">Comment # 15</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Unite op_get_by_id_with_this with op_get_by_id"
href="https://bugs.webkit.org/show_bug.cgi?id=162124">bug 162124</a>
from <span class="vcard"><a class="email" href="mailto:ticaiolima@gmail.com" title="Caio Lima <ticaiolima@gmail.com>"> <span class="fn">Caio Lima</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=162124#c13">comment #13</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=289377&action=diff" name="attach_289377" title="Patch">attachment 289377</a> <a href="attachment.cgi?id=289377&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=289377&action=review">https://bugs.webkit.org/attachment.cgi?id=289377&action=review</a>
>
> > Source/JavaScriptCore/ChangeLog:11
> > + This patch is merging the op_get_by_id_with_this with op_get_by_id and
> > + this way we enable get_by_id optimizations such as Monomorphic/Polymorphic Inline
> > + Cache on JIT layers for super member access. These optimizations is improving access
> > + of super members in ~20%.
>
> Fully unoptimized property access is 10X slower than fully optimized
> property access. Therefore, it's surprising that this patch is not a bigger
> win on super-get-by-id-with-this-monomorphic. It looks like
> super-get-by-id-with-this-monomorphic is a getter/setter benchmark. Can you
> verify that the FTL successfully inlines the getter and setter for value()?
> Perhaps the win on this benchmark is not bigger because the benchmark
> includes an intermediate "calc" function, which is pretty expensive. Can you
> report the speedup on this benchmark if you remove the call to calc?</span >
Removed from benchmark setter, calc and ArrayAccess and got the following report:
super-get-by-id-with-this-monomorphic 16.7063+-1.1934 ^ 10.8042+-0.4034 ^ definitely 1.5463x faster
The code running is:
```
class A {
constructor(x) { this._value = x; }
set value(x) { this._value = x; }
get value() { return this._value; }
}
class B extends A {
set value(x) { super.value = x; }
get value() { return super.value; }
}
const bench = (init, num) => {
let arr = [];
let sum = 0;
for (let i = 0; i != num; ++i){
let o = new B(init);
sum += o.value;
}
};
bench(2, 10000);
bench(1 << 30, 10000);
bench(42.2, 10000);
bench(42.5e10, 10000);
```
I was expecting improvements on getter access cases. When they are inlined, it still calls the getter function, so I suppose the speedup is not in the same order of magnitude of non-getter properties, that is just an ```move``` using the property offset.
I thought 20% was good, because I was using L. Peter Deutsch and Allan M. Schiffman's work as sand line ("Efficient implementation of the smalltalk-80 system"). On their paper, they reported that "SOAR (a Smalltalk implementation for a RISC processor) would have been 33% slower without inline caching" on page 14. Do you have any reference that evaluates speedups on x86_64 arch?
Also, What do you think about ~50% speedup?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>