Closed
Bug 68074
Opened 24 years ago
Closed 19 days ago
Lots of CreateInstances of nsEventListenerManagers at startup
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: sfraser_bugs, Unassigned)
References
Details
(Keywords: perf, Whiteboard: [nav+perf], [domcore-bugbash-triaged])
Attachments
(1 file, 1 obsolete file)
Some analaysis of an XPCOM log for startup and display of a simple HTML page in a
Mozilla browser window shows that we create 1054 instances of
nsEventListenerManagers. This seems a lot, and perhaps could be optimized.
Reporter | ||
Comment 1•24 years ago
|
||
Most of these nsEventListenerManagers seem to be created by nsXULElement's call
to element->AddScriptEventListener(). At 80 bytes a pop, this is quite a space
hog too.
Comment 2•24 years ago
|
||
Is our XUL using a bunch of onclick attributes, or some such? What's further up
the stack in these calls to AddScriptEventListener?
/be
Comment 3•24 years ago
|
||
Or worse, a XUL template with event handlers inside the <template>?
alecf/ben/mcafee, you should do a pass through navigator.xul and its overlays.
(sspitzer, same for mail.) Search for the `datasources' attribute; make sure
that there are no event handlers contained inside a <template>.
Comment 4•24 years ago
|
||
found a bunch of badness in the mailnews xul.
mailWindowOverlay.xul
oncommand="MsgMoveMessage(event.target)"
oncommand="MsgCopyMessage(event.target)"
oncommand="MsgGetMessagesForAccount(event)"
messengercompose.xul
oncommand="MessageFcc(event.target)"
msgFolderPickerOverlay.xul
oncommand="PickedMsgFolder(event.target,'msgNewFolderPicker')"
etc. (basically, every folder picker that I wrote is evil)
FilterListDialog.xul
onclick="onToggleEnabled(event);"
pref-composing_messages.xul
oncreate="dump('CREATE MENU NOW\n');"
I'll go start a new bug to track the clean up of the mailnews xul.
thanks for the heads up waterson / sfraser.
Comment 7•24 years ago
|
||
Here's my list:
navigator.xul
oncommand="OpenBookmarkURL(event.target,document.getElementById('BookmarksMenu').database)"
/>
oncommand="OpenBookmarkURL(event.target,
document.getElementById('innermostBox').database);"/>
oncommand="OpenBookmarkURL(event.target,
document.getElementById('innermostBox').database)"/>
navigatorOverlay.xul
oncommand="selectLocale(event)"
oncommand="applyTheme(event.target)"
oncommand="OpenBookmarkURL(event.target,
document.getElementById('BookmarksMenu').database)"
internetresults.xul
oncommand="doEngineClick(event, this);"
search-editor.xul
oncommand="return chooseCategory(this);"
oncommand="chooseCategory(this);"
oncommand="saveEngines();"
sidebarOverlays.xul
oncommand="SidebarTogglePanel(event.target);"
charsetOverlay.xul
oncommand="SelectDetectors( event )"
taskbarOverlay.xul
oncommand="rdf:http://home.netscape.com/NC-rdf#content"
tasksOverlay.xul
oncommand="ShowWindowFromResource(event.target)"
Comment 8•24 years ago
|
||
ok here's what needs to be done:
1) you need to find the most logical container for the template - i.e. the
<tree> or <menulist> - and move the onclick or oncommand handler there
2) look at the event handler code, and figure out if it was dependent on the
command handler being in the child node.. look for references to event.target,
and more importantly, test it out. 9 times out of 10, it's not dependent and you
can just move the event handler.
Comment 9•24 years ago
|
||
mcafee, I'm giving this bug to you since you've been working on this
Assignee: saari → mcafee
Reporter | ||
Comment 10•24 years ago
|
||
slee: what I mumbled in the meeting was to replace the CreateInstance of the
nsEventListenerManager with a call to NS_NewEventListenerManager if you can (i.e.
if the things are being created in the content DLL. This avoids a trip through
XPCOM.
Comment 11•24 years ago
|
||
Comment 12•24 years ago
|
||
I went through the browser files and found some cases
where we could move oncommand stuff outside of templates.
I tested each one of these by first breaking it (removing
the command handler), then adding it back into the new
place to restore the functionality.
Some of the JS functions were used in other JS, and sometimes
it looked like the JS needed the handler in the template code.
I managed to get changes for navigator.xul, navigatorOverlay.xul,
and sidebarOverlays.xul. Files I had trouble with:
internetresults.xul : ? I couldn't understand how to test this
search-editor.xul: Other JS usages of chooseCategory(), more changes needed.
taskbarOverlay.xul: Didn't work
tasksOverlay.xul: ShowWindowFromResource() not working on linux, couldn't test.
Comment 13•24 years ago
|
||
Comment 14•24 years ago
|
||
these changes look great - you don't need to add the comment about the handlers
moving to the template - they shouldn't have been there in the first place, and
everywhere else they're outside the template already
sr=alecf on the latest patch if you remove those comments
Comment 15•24 years ago
|
||
ok thanks alec
Updated•24 years ago
|
OS: Mac System 8.5 → All
Comment 16•24 years ago
|
||
2nd patch checked in.
Comment 17•24 years ago
|
||
nav triage team:
Chris, are there still any remaining issues? Why is this bug still open?
Comment 18•24 years ago
|
||
This is open per smfr's comment about avoiding xpcom/dll trip
Comment 19•24 years ago
|
||
nav triage team:
Marking nsbeta1+, mozilla0.9.2, reassigning to pchen
Comment 20•24 years ago
|
||
nav triage team:
Marking p3 and mozilla0.9.3
Priority: -- → P3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Updated•24 years ago
|
Whiteboard: [nav+perf]
Comment 22•24 years ago
|
||
nav triage team:
Avoiding trip through xpcom not that critical. Marking nsbeta1- and future
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
Updated•22 years ago
|
QA Contact: rakeshmishra → trix
Updated•17 years ago
|
Attachment #27366 -
Attachment is obsolete: true
Comment 25•17 years ago
|
||
Comment on attachment 27430 [details] [diff] [review]
2nd patch, resolves cvs conflicts
[Checkin: Comment 25]
(In reply to comment #16)
> 2nd patch checked in.
A (code and comment) modified version was checked in:
[
2006-09-13 22:46 mcafee%netscape.com mozilla/suite/browser/navigator.xul 1.278
2006-09-13 22:46 mcafee%netscape.com mozilla/suite/browser/navigatorOverlay.xul 1.179
2006-07-27 07:47 mcafee%netscape.com mozilla/suite/common/sidebar/sidebarOverlay.xul 1.56
]
NB: The (2006) timestamps are unexpected ... There seems to be something wrong with Bonsaï (for this, and other, checkins) :-<
Attachment #27430 -
Attachment description: 2nd patch, resolves cvs conflicts → 2nd patch, resolves cvs conflicts
[Checkin: Comment 25]
Updated•17 years ago
|
Assignee: saari → nobody
Priority: P3 → --
QA Contact: ian → events
Target Milestone: Future → ---
Comment 26•17 years ago
|
||
blocking1.9=?:
not mandatory, but as it is marked as 'perf' and seems easy enough to do...
Flags: blocking1.9?
Comment 27•17 years ago
|
||
(In reply to comment #26)
> blocking1.9=?:
> not mandatory, but as it is marked as 'perf' and seems easy enough to do...
>
What is left to do here? Likely not going to block but would *happily* take a patch.
Comment 28•17 years ago
|
||
(In reply to comment #27)
> What is left to do here?
I don't know precisely yet:
see comment 12 and bug 68174 comment 19...
Comment 29•17 years ago
|
||
When we know what we want you can re-nom but not clear to me we should block on this
Flags: blocking1.9? → blocking1.9-
Comment 30•17 years ago
|
||
Currently when starting FF, ~320 ELMs are created.
This seems to be in wrong component. Firefox-generic might be a better one, if
the count of event listener attributes in UI should be reduced?
Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Updated•2 years ago
|
Severity: normal → S3
Updated•19 days ago
|
Status: NEW → RESOLVED
Closed: 19 days ago
Resolution: --- → INCOMPLETE
Whiteboard: [nav+perf] → [nav+perf], [domcore-bugbash-triaged]
You need to log in
before you can comment on or make changes to this bug.
Description
•