Closed
Bug 406671
Opened 17 years ago
Closed 17 years ago
nsWindowSH::GetProperty() is slow.
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9beta2
People
(Reporter: jst, Assigned: jst)
References
Details
(Keywords: perf)
Attachments
(1 file)
1.81 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
sicking
:
approval1.9+
|
Details | Diff | Splinter Review |
nsWindowSH::GetProperty() is showing up pretty high in profiles, and can be made faster. The biggest offender is the call to XPConnect's GetWrappedNativeOfJSObject(), which we call to check if the cached property value is a window object, and we do that so that the wrappers (XPCSafeJSObjectWrapper and XPCCrossOriginWrapper) can do the proper wrapping of the values. We can trivially avoid most of the calls into GetWrappedNativeOfJSObject() by checking if the JSClass name is such that the value is likely to be a window, and only then do the expensive call. This shaves off about 9% of the XPConnect overhead as seen in bug 375225. Patch coming up.
Attachment #291329 -
Flags: superreview?(peterv)
Attachment #291329 -
Flags: review?(peterv)
Comment 1•17 years ago
|
||
Comment on attachment 291329 [details] [diff] [review] Don't call GetWrappedNativeOfJSObject unless we're likely to find what we need. >diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp >+ if ((*name == 'W' && strcmp(name, "Window") == 0) || >+ (*name == 'C' && strcmp(name, "ChromeWindow") == 0)) { This needs to handle ModalContentWindow too. Maybe add a comment to make it clear that it is vital to keep this list up-to-date.
Attachment #291329 -
Flags: superreview?(peterv)
Attachment #291329 -
Flags: superreview+
Attachment #291329 -
Flags: review?(peterv)
Attachment #291329 -
Flags: review+
Attachment #291329 -
Flags: review+
Attachment #291329 -
Flags: review+ → approval1.9+
Assignee | ||
Comment 2•17 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite-
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•