Open Bug 115049 Opened 18 years ago Updated 1 year ago

Fast path for GetPrimaryFrameFor

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

People

(Reporter: rbs, Unassigned)

References

Details

(Keywords: perf)

Attachments

(1 file)

I had noted something ago that GPFF is often called in succession for the same 
content from within different functions in nsCSSFrameConstructor. To cater for 
this, what about adding a one-entry cache (or perhaps two or three entries?)

For the purpose of filing this bug, I used the following |printf| to inspect 
what was happening, I will attach the output that I get with this when launching 
Mozilla with "about:blank" and without the sidebar. On the ouput, notice the 
particular case of content:03414EE0 which is requested numerous times in 
succession. (The hashtable may already been suffling elements to speed 
successive lookups, in which case a one-entry cache would save from re-computing 
the hashkey.)

Index: nsFrameManager.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsFrameManager.cpp,v
retrieving revision 1.97
diff -u -6 -r1.97 nsFrameManager.cpp
--- nsFrameManager.cpp  11 Dec 2001 05:41:42 -0000      1.97
+++ nsFrameManager.cpp  13 Dec 2001 12:54:08 -0000
@@ -601,12 +601,13 @@
   nsresult rv;
   if (mPrimaryFrameMap.ops) {
     PrimaryFrameMapEntry *entry = NS_STATIC_CAST(PrimaryFrameMapEntry*,
         PL_DHashTableOperate(&mPrimaryFrameMap, aContent, PL_DHASH_LOOKUP));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       *aResult = entry->frame;
+printf("GPFF content:%p frame:%p\n", aContent, *aResult);
     } else {
[...]
Attached file requests of GPFF
Keywords: perf
We should probably figure out why it's being called so much and reduce the need
to call it (like bug 109428).
Target Milestone: --- → mozilla1.1
Can we do a profile again to see if we are still that bad
Blocks: 85755
Target Milestone: mozilla1.1alpha → mozilla1.1beta
Keywords: mozilla1.2
just4info: GetPrimaryFrameFor just very recently has shown up by a profile in 
bug 145425 comment #37
Blocks: 145425
.
Assignee: attinasi → misc
Component: Layout → Layout: Misc Code
Target Milestone: mozilla1.1beta → ---
Assignee: layout.misc-code → nobody
QA Contact: chrispetersen → layout.misc-code
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.