Closed
Bug 112525
Opened 24 years ago
Closed 24 years ago
O(n^2) when dispatching events in nsView :: HandleEvent
Categories
(Core Graveyard :: GFX, defect)
Core Graveyard
GFX
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla0.9.7
People
(Reporter: kmcclusk, Assigned: kmcclusk)
References
Details
(Keywords: perf)
Attachments
(1 file)
2.30 KB,
patch
|
kinmoz
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
The nsView::HandleEvent logic is Order(n^2) because it calls nsView::GetChild
which searches a linked list of view's as it is traversing views during event
dispatch.
Getting rid of the call to GetChild produces a substantial speed improvement on
the 300 combo box example in bug 39544
Un-modified (seconds)
---------------------
47.989
50.753
53.176
Avoiding O(n^2) call to GetChild
---------------------------------
17.736
18.327
19.718
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
This is the right idea, but all this code is going to have to go away when I fix
event handling for z-index and all that. (HandleEvent is going to call
CreateDisplayList and then traverse the display list, which will require a
different way of handling the "views deleted while handling event" problem. It
will fix the O(n^2) behaviour too.)
So I'd be happy to approve this but I will be taking it out again in a week or
two :-).
r=roc+moz
Comment on attachment 59635 [details] [diff] [review]
Patch which removes the O(n^2) call to GetChild in nsView::HandleEvent
sr=kin@netscape.com
Attachment #59635 -
Flags: superreview+
Attachment #59635 -
Flags: review+
Assignee | ||
Comment 6•24 years ago
|
||
Fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•24 years ago
|
||
I filed bug 112861 for the extra events that are generated during the creation
of child windows. These events were the primary cause of the page load slowdown
on pages with large numbers of comboboxes because they were causing the O(n^2)
code in the viewmanager to be executed.
Now that the fix in this bug has been checked in these events have less of an
impact, but should still be suppressed to further improve performance on pages
with lots of views.
Updated•17 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•