NEW 118513
Cache property access for JSC API static functions
https://bugs.webkit.org/show_bug.cgi?id=118513
Summary Cache property access for JSC API static functions
Yi Shen
Reported 2013-07-09 10:17:21 PDT
By caching property access, the JSC API static function call could be 1/4 times faster than before.
Attachments
Test case (411 bytes, text/html)
2013-07-09 10:27 PDT, Yi Shen
no flags
proposal patch (2.49 KB, patch)
2013-07-09 10:30 PDT, Yi Shen
ggaren: review-
Yi Shen
Comment 1 2013-07-09 10:27:48 PDT
Created attachment 206339 [details] Test case
Yi Shen
Comment 2 2013-07-09 10:28:56 PDT
No cache Cache result(ms) 1. 8000 6003 2. 7600 5947 3. 7987 5912 4. 8002 5886 5. 8155 5934 6. 7539 5953 7. 8562 5958 8. 7455 5952 9. 7936 5913 10. 7461 5910 ------------------------------ avg 7869 5937
Yi Shen
Comment 3 2013-07-09 10:30:16 PDT
Created attachment 206340 [details] proposal patch
Geoffrey Garen
Comment 4 2013-07-10 10:26:01 PDT
Comment on attachment 206340 [details] proposal patch I don't think this is correct. Client functions are allowed to make arbitrary decisions, and we can't assume they'll make the same decision each time.
Yi Shen
Comment 5 2013-07-11 11:19:20 PDT
Thanks for review! Could you please explain a bit more about the 'arbitrary decisions' that you have mentioned? As I noticed that the JSCallbackObject<Parent>::staticFunctionGetter() always checks for cached or override property when it gets called. So, I added a similar check before calling staticFunctionGetter() and pass the cached property to the property slot only if it exists. By doing this, we can cache the property access through tryCacheGetByID() (JITStubs.cpp). (In reply to comment #4) > (From update of attachment 206340 [details]) > I don't think this is correct. > > Client functions are allowed to make arbitrary decisions, and we can't assume they'll make the same decision each time.
Note You need to log in before you can comment on or make changes to this bug.