Closed Bug 1029157 Opened 10 years ago Closed 10 years ago

Consider removing sCachedComputedDOMStyle

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(2 files)

sCachedComputedDOMStyle is being used to store a single dtor'ed block of memory for a nsComputedDOMStyle, and is pretty scary.  In the glorious world of jemalloc, I can't imagine it helps performance.  We should try to confirm that, and remove it, assuming it does not regress performance.
I'm not sure exactly what perf testing should be done.
Blocks: 1029137
Not sure I trust jemalloc to be super fast, but the cache was added _long_ ago in Bug 155525, 
so many things have changed since. Like, SnowWhite kills CDS objects asynchronously.
So we may have a cached object right after SnowWhite has run, but once it has been use, the
cache won't be there until Snowwhite kills another CDS.
FWIW, I've removed several custom allocators dating back to pre-jemalloc days, and none of the removals affected performance. I'd be optimistic: remove it, land, and see if you get any regression emails :)
Do you have any thoughts on what sort of test I should run, Boris?  As Olli points out, the cache hit rate is probably not very high nowadays anyways.
Flags: needinfo?(bzbarsky)
Assignee: nobody → continuation
Oh, this is caching the memory, not an object?  Just kill it, and sorry you ended up having to think about this.  :(  I can't think of cases where it would be useful: in a tight loop we'd not end up with a live thing until GC anyway.
Flags: needinfo?(bzbarsky)
Yeah, it calls the dtor on the object, then sticks it in the global.  When you create a new one, it calls the ctor on the block.  So it is just saving the malloc/free call, not any initialization.
Comment on attachment 8446025 [details] [diff] [review]
Eliminate sCachedComputedDOMStyle.

r=me
Attachment #8446025 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/68dddeca55d2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: