Bug 31362

Summary: [V8] Optimize getDOMNodeMap()
Product: WebKit Reporter: Jens Alfke <jens>
Component: WebCore Misc.Assignee: Jens Alfke <jens>
Status: RESOLVED FIXED    
Severity: Enhancement    
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 31217    
Attachments:
Description Flags
patch dglazkov: review+

Description Jens Alfke 2009-11-11 11:10:32 PST
Created attachment 42980 [details]
patch

getDOMNodeMap() (in V8DOMMap.cpp) is a surprisingly hot function in Dromaeo DOM benchmarks, enough so that I decided to optimize it somewhat. What I've done is inline together several of the calls that it makes — the function's not really doing much, so quite a lot of its time is just spent in function prolog/epilog boilerplate.

This took a bit more code-shuffling than it seems it ought to, because the code to be inlined wasn't all in the same source file; so I had to move some stuff from DOMData to MainThreadDOMData.

Result was that time spent in this function shrank by about half in my Shark profiles. Dromaeo scores improved 'a bit'; the test results on my machine are pretty noisy, but I saw consistently 1-2% better numbers. Which isn't a lot, but these things add up.
Comment 1 Dimitri Glazkov (Google) 2009-11-11 11:13:09 PST
Comment on attachment 42980 [details]
patch

r=me.
Comment 2 Jens Alfke 2009-11-11 11:20:34 PST
Committed revision 50826.