Optimize row iteration in CalcUnpaginagedHeight

ASSIGNED

Status

()

Core
Layout: Tables
ASSIGNED
9 years ago
6 years ago

People

(Reporter: dholbert, Assigned: SADINENI RAVI CHANDRA)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

9 years ago
Bernd found a performance bug in bug 479166 comment 1, from code inspection.  Quoting his comment:

> The called code at
> http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/tables/nsTableCellFrame.cpp&rev=3.414&mark=774,775,785-793#763
> 
> looks like a performance penalty. We first look up a the row parent of the
> cell. Its naturally the first row, and then instead of starting the loop there
> we loop over *all* rows till we find the first row that is covered by the cell.

I'm filing this bug about fixing that issue, per bug 479166 comment 3.
(Assignee)

Comment 1

6 years ago
i would like to work on this bug ...  so i think its enough if you remove first assignment in the for loop. please correct me if i am wrong . and can you please assign me this bug

Thanks
(Reporter)

Comment 2

6 years ago
Thanks!

I believe Bernd's point was that we should start that loop with...
   for (row = rowIndex
...instead of...
   for (row = firstRGInFlow->GetFirstRow()
...because the loop body doesn't do anything until row is >= rowIndex anyway.

(Bernd, correct me if I'm wrong)
Assignee: nobody → ravicat2013
Status: NEW → ASSIGNED
(Reporter)

Comment 3

6 years ago
Sorry, disregard that last comment; I misread the code & was confusing row & rowX & made no sense.

I believe comment 1 is what Bernd had in mind, but I haven't looked at the code hard enough yet to be sure.
You need to log in before you can comment on or make changes to this bug.