Open Bug 240561 Opened 21 years ago Updated 2 years ago

nsTableRowGroupFrame::Count makes long tables O(N^2)

Categories

(Core :: Layout: Tables, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: helpwanted, perf)

Every append ends up calling nsTableRowGroupFrame::GetRowCount (from nsTableRowGroupFrame::AppendFrames, so that we can convert to row indices for cellmap maintenance, looks like). GetRowCount walks our entire child list.... Not sure what the best solution is here, though. Adding members doesn't seem warranted; this is O(N^2), but with a _very_ low constant, really.
does that appear on any jprof?
Yes, that's how I found it. It was about 5% of the total time for loading a rather large table (hence my comment about low constant).
Blocks: 54542
Keywords: perf
there is http://lxr.mozilla.org/seamonkey/source/layout/html/table/src/nsCellMap.h#476 which holds the right information so we need just to drill through the table frame to the table cellmap down to the right cellmap and get the info.
Keywords: helpwanted
Summary: nsTableRowGroup::Count makes long tables O(N^2) → nsTableRowGroupFrame::Count makes long tables O(N^2)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.