Closed Bug 934946 Opened 9 years ago Closed 9 years ago

Add most-recently-used-contentlists cache

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(3 files)

Attached patch patchSplinter Review
Looks like adding a simple most-recently-used-contentlists cache helps
about 20% with Bug 916851, and it also speeds up dromaeo dom-query.

Somewhat dirty approach. In theory a hashtable should just do its job fast enough, though
this kind of cache let's one to inline more I guess.
I tried few sizes and 31 seemed to give quite stable results without being too huge.

https://tbpl.mozilla.org/?tree=Try&rev=be36926b326b

I tried adding also 3rd level of cache, by caching the most recently used list.
That helped even more with dromaeo dom-query, but was worse with Bug 916851 -
as expected.
Attachment #827338 - Flags: review?(bzbarsky)
So I tried this, and it's faster than what we have now, but not as fast as having 31-element cache.  In fact, it about splits the difference between that 31-element cache and now.
Comment on attachment 827338 [details] [diff] [review]
patch

Could we wrap up the cache in a struct with at least a method to compute the right index?

>+  uint32_t mHash;

const uint32_t.

r=me with that, since I have no better ideas.  :(
Attachment #827338 - Flags: review?(bzbarsky) → review+
Not sure about the struct, but a helper method would be nice indeed.
https://hg.mozilla.org/mozilla-central/rev/5ee306a9908d
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.