Closed Bug 403287 Opened 17 years ago Closed 17 years ago

nsDisplayList::OptimizeVisibility should use an nsAutoTArray

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: pavlov, Assigned: pavlov)

Details

(Keywords: memory-footprint, perf)

Attachments

(1 file)

Attached patch fixSplinter Review
I'm seeing a lot of allocations from the nsVoidArray in nsDisplayList::OptimizeVisibility/nsDisplayList::FlattenTo that we can easily eliminate.

After browing a bunch of pages the biggest display list array length I saw was 480 so 512 should be big enough for most things and prevent us from having to allocate in most cases.
Attachment #288100 - Flags: superreview?
Attachment #288100 - Flags: review?
Attachment #288100 - Flags: superreview?(roc)
Attachment #288100 - Flags: superreview?
Attachment #288100 - Flags: review?(roc)
Attachment #288100 - Flags: review?
Comment on attachment 288100 [details] [diff] [review]
fix

+    nsDisplayItem* item = elements.ElementAt(i);
+    nsDisplayItem* belowItem = i < 1 ? nsnull : elements.ElementAt(i - 1);

Should just use [] instead of ElementAt.
Attachment #288100 - Flags: superreview?(roc)
Attachment #288100 - Flags: superreview+
Attachment #288100 - Flags: review?(roc)
Attachment #288100 - Flags: review+
Attachment #288100 - Flags: approval1.9?
Comment on attachment 288100 [details] [diff] [review]
fix

a+ for mem frag fix.  Rockin!
Attachment #288100 - Flags: approval1.9? → approval1.9+
changed to using [] instead of ElementAt and checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: