nsDisplayList::OptimizeVisibility should use an nsAutoTArray

RESOLVED FIXED

Status

()

RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: pavlov, Assigned: pavlov)

Tracking

({memory-footprint, perf})

Trunk
memory-footprint, perf
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
Created attachment 288100 [details] [diff] [review]
fix

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?
(Assignee)

Updated

11 years ago
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 2

11 years ago
Comment on attachment 288100 [details] [diff] [review]
fix

a+ for mem frag fix.  Rockin!
Attachment #288100 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 3

11 years ago
changed to using [] instead of ElementAt and checked in.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.