Open Bug 63731 Opened 24 years ago Updated 2 years ago

font prefs panel is slow (nsMenuFrame::GetPrefSize)

Categories

(Core :: XUL, defect)

defect

Tracking

()

Future

People

(Reporter: dbaron, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [nav+perf])

Attachments

(1 file)

DESCRIPTION:  I was investigating why the fonts pref panel loads so slowly, and
I found (with jprof) that a lot of the time was being spent in nsMenuFrame
reflow methods -- slightly over half the time loading the font prefs panel was
within nsMenuFrame::GetPrefSize.  So, I created a testcase of a very large menu,
and the profile was similar (except about 4/5 of the time was within
nsMenuFrame::GetPrefSize).  This testcase also takes rather a long time to load,
although it seems to be O(N) in the number of menuitems.

FWIW, the same testcase with the equivalent HTML seemed to take about the same
amount of time.  Maybe I just have too many fonts...
->pinkerton
Assignee: trudelle → pinkerton
cool, thanks for the profiles. I'll check this out. cc'ing hyatt too.
Status: NEW → ASSIGNED
Keywords: perf
Summary: font prefs panel is slow → font prefs panel is slow (nsMenuFrame::GetPrefSize)
Target Milestone: --- → mozilla0.9
I was looking at this with dbaron earlier.  It's probably insignificant, since 
it's not a big deal in the profiles, but the fonts (js) code contains a 
ridiculously high number of getElementsByAttribute() calls in nested loops, 
which should be fairly expensive.
Target Milestone: mozilla0.9 → mozilla1.0
Some of the biggest offenders:

nsCSSFrameConstructor::ContentInserted
nsCSSFrameConstructor::ConstructFrame
nsCSSFrameConstructor::ConstructXULFrame
nsCSSFrameConstructor::ProcessChildren
nsXULDocument::AttributeChanged
nsXULElement::SetAttribute
nsMenuFrame::GetPrefSize
nsMenuFrame::MarkAsGenerated
--> me to look into what can be done on the xpapps side of things...
Assignee: pinkerton → blake
Status: ASSIGNED → NEW
Whiteboard: [nav+perf]
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: mozilla1.0 → mozilla0.9.3
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Mass moving lower-priority bugs to 0.9.6 (with Blake's pre-consent) to make room
for remaining 0.9.4/eMojo bugs and MachV planning, performance and feature work.
 If anyone disagrees with the new target, please let me know.
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Target Milestone: mozilla0.9.6 → mozilla1.0
This is an interesting bug.  The menu lists are actually having to build their
subcontent because the flexibility check is busted in nsMenuFrame.  It doesn't
take grids into account (in the case of grid, the flex is applied from the
column, and since the code doesn't check for that, it thinks the menulists are
inflexible and therefore need to intrinsically size).
Target Milestone: mozilla1.0 → mozilla1.1
would this be affected by [dependent on?] bug 26670? just curious...
*** Bug 115828 has been marked as a duplicate of this bug. ***
Seen on Mac os 10.1 (commercial build: 2002-01-18-08-trunk), one of the color
preferences panel loads so slowly while clicking to different panels like Themes
or history. It sometimes takes forever-- this needs to be fixed.
what patty meant to say is that there's a long wait when switching btwn colors
-> themes or colors -> history. oddly, i cannot repro this on a G3 running mac
os 10.1.2, using today's mozilla bits. hmm.
-> default owner
Assignee: blaker → hyatt
Status: ASSIGNED → NEW
Target Milestone: mozilla1.1 → ---
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
Assignee: hyatt → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: