Open
Bug 60403
Opened 24 years ago
Updated 2 years ago
layout reflow states use too much stack space
Categories
(Core :: Layout, defect, P2)
Core
Layout
Tracking
()
NEW
Future
People
(Reporter: buster, Unassigned)
References
Details
(Keywords: perf)
Reflow states are created on the stack, one per child frame. Each reflow state is over 150 bytes. So the total amount of stack space used by a reflow state is more than (150 bytes * max_depth_of_frame_tree), where the max depth for a "normal" page is typically double digits, but for some documents can get into the hundreds. The difference between one reflow state and it's child are typically very few. We should be able to be clever about how we create reflow states. We should be able to create a class that only contains the differences between one reflow state and another, for example. Maybe we create a class that only holds the info that is unique to it, and walks up the reflow state tree to find other info. Alternately, we could create a "core" reflow state and an "auxiliary" reflow state. The core is always created, and it contains the major attributes. The "auxiliary" reflow state is created whenever any attribute within it is different than it's parent. Otherwise, it just points up the hierarchy to the one that contains the common shared info.
moving to mozilla0.9
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Some thoughts: 1. the cached style struct pointers might be a waste of space. We get style structs from frames all the time. we should look in the profile and see if there is any significant time savings to keeping these cached pointers around, and if not get rid of them (24 bytes per context) 2. there is no real attempt to pack bits together. there are 2 bools, nsCSSFrameType which is currently 32 bits but could easily be just 8 bits (or less), and nsReflowReason which is currently 32 bits but could easily be 8 bits (or less). mReflowDepth need not be 32 bits.
Comment 5•23 years ago
|
||
Build reassigning Buster's bugs to Marc.
Assignee: buster → attinasi
Status: ASSIGNED → NEW
Updated•23 years ago
|
Updated•23 years ago
|
Keywords: mozilla1.0
Updated•23 years ago
|
Keywords: mozilla1.0+
Updated•23 years ago
|
Keywords: mozilla1.0
Comment 6•23 years ago
|
||
Until we know how much bloat the reflow state contributes, and how much would be saved by making changes, I'd suggest we put this on hold and NOT try to fix ot for Mozilla 1.0 - it is too unclear if there is any significant benefit to this, and we are short on resources at it is. BTW: reflow state is allocated on the stack, during reflow only. The bloat it contributes is transitory and will not cause fragmentation of the heap either[1]. (1) there are some cases where we use the heap to allocate reflow states, but it is very rare.
Keywords: nsbeta1-
Updated•22 years ago
|
Keywords: mozilla1.0+ → mozilla1.0-
Updated•22 years ago
|
Keywords: mozilla1.2
Comment 7•22 years ago
|
||
Any info in the meantime how much bloat the reflow state contributes (resp. how much we could save)?
Comment 8•22 years ago
|
||
Reassigning to other@layout.bugs until someone is willing to take this.
Comment 9•22 years ago
|
||
How about getting the component right too, huh?
Component: Layout → Layout: Misc Code
Comment 10•22 years ago
|
||
How about getting the component right too, huh?
Assignee: other → misc
QA Contact: petersen → nobody
Summary: layout reflow states cause a lot of bloat → layout reflow states use too much stack space
Keywords: footprint
Comment 11•22 years ago
|
||
Why do we need reflow state and all the code required to manage it? Wouldn't brute force approach that kept state in the content and frame trees work as well, or nearly so, in terms of dynamic memory -- and much better in terms of code footprint and simplicity, eliminating bugs? /be
Comment 12•22 years ago
|
||
Unfortunately, that could be fairly costly in terms of static footprint... We have a _lot_ of frames; making them all bigger by a few hundred (or even a few dozen) bytes each could be very painful...
We could just move reflow states to a linked list on the heap (with recycling so we don't thrash the heap during reflow).
Updated•22 years ago
|
Target Milestone: --- → Future
Updated•15 years ago
|
Assignee: layout.misc-code → nobody
QA Contact: nobody → layout.misc-code
Updated•6 years ago
|
Product: Core → Core Graveyard
Assignee | ||
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•