Closed Bug 12362 Opened 25 years ago Closed 25 years ago

Too many calls to free()

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: troy, Assigned: rickg)

References

()

Details

(Whiteboard: [Perf] 9/16 Requested verification by reporter)

Peter, in looking into the performance problems in loading this URL I ran Quantify on an optimized build with symbols. While loading the page we're spending 16% of the total time in free(). 57% is in freeing the buffer allocated by nsString and nsAutoString that end up allocating from the heap (calls to nsStr::Destroy) 38.47% of the nsAutoString frees (8,586) are from SelectorMatches() and 7.34% (1,554) are from HTMLStyleSheetImpl::RulesMatching Maybe the stack buffer can be slightly larger or maybe we need to use a free list or some other mechanism to reduce the number of heap allocations
Blocks: 11702
Summary: [PERF] Too many calls to free() → Too many calls to free()
Whiteboard: [Perf]
Assignee: peterl → rickg
Peter, I'm assigning this to Rick, because he was telling me today that one of the things he's planning on doing this weekend is looking into strings. Specifically, he's planning on analyzing usage to determine an optimal size for the nsAutoString stack buffer, and adding a string pool so we don't always use the heap Rick, once you're done close this bug out and I'll re-run and see how we're doing
Status: NEW → ASSIGNED
That's the last time I agree to be helpful; all I do is open my mouth and get new bugs. :)
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I updated the string class to allocate slightly larger buffers. It appears to reduce the number of alloc/frees in the string class by 25%.
Whiteboard: [Perf] → [Perf] 9/16 Requested verification by reporter
Troy: I am unable to verify this fixed. Could you please do so if you agree with fix? Thanks
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.