Open Bug 372084 Opened 19 years ago Updated 1 year ago

Redundant calls to nsFrame::IntrinsicWidthOffsets

Categories

(Core :: Layout: Tables, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

Details

(Keywords: perf)

Looking at the profile for bug 352367, we call nsFrame::IntrinsicWidthOffsets from GetWidthInfo(nsIRenderingContext*, nsTableCellFrame*, nsStylePosition const*) three times -- once via GetMinWidth, once via GetPrefWidth, and once directly. Is there any way we could combine these so we only have to do this once? About 5% of the pageload there is spent under nsFrame::IntrinsicWidthOffsets...
Flags: blocking1.9?
Blocks: 352367
Flags: blocking1.9? → blocking1.9-
I guess the GetMinWidth and GetPrefWidth calls call nsFrame::IntrinsicWidthOffsets on the block inside the table cell, while the direct call is for the table cell itself...
One option would be to have a one-slot cache: Basically have a static nsIFrame* that callers who plan to call both GetMinWidth and GetPrefWidth can assign to, and a boolean indicating whether for that nsIFrame* the offsets have already been computed. If the boolean is set, just use the cached offsets, otherwise compute into the cached offset struct... Seems like a lot of work for effectively a 2% win on this rather abnormal testcase.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.