[Webkit-unassigned] [Bug 162124] Unite op_get_by_id_with_this with op_get_by_id

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 23 00:27:12 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=162124

--- Comment #15 from Caio Lima <ticaiolima at gmail.com> ---
(In reply to comment #13)
> Comment on attachment 289377 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=289377&action=review
> 
> > 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?

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?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160923/e4bed629/attachment.html>


More information about the webkit-unassigned mailing list