Closed Bug 1637145 Opened 5 years ago Closed 5 years ago

Improve the performance when generating FlexLines for flex container's non-first-in-flows

Categories

(Core :: Layout: Flexbox, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(3 files)

Per dholbert's review comment, the way we generate FlexLines for flex container's non-first-in-flows has the worst-case performance of O(n^3) where n is the number of flex items.

We should improve the performance.

This will be my next todo after bug 1622935 landed.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Priority: -- → P1

By changing the FlexLines and FlexItems generated in flex container's
first-in-flow in CSS "order" aware order (i.e. reverse them again if the
flex container's internal axes are reversed), we can construct FlexItems
for flex container's next-in-flows in linear time because once we find a
FlexItem in the stored FlexLines via FlexItemIterator to construct a new
FlexItem for a child frame, the FlexItem for the next child frame can
only be found in a later entry (either in a later item in the same line,
or an item in a later line).

Depends on D75154

Depends on: 1639053
Attachment #9148092 - Attachment description: Bug 1637145 Part 1 - Move generating FlexLines and FlexItems for flex container's next-in-flows into a helper methods. → Bug 1637145 Part 1 - Create a helper method for the code that generates FlexLines and FlexItems for a flex container's next-in-flows.
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ad89f466d991 Part 1 - Create a helper method for the code that generates FlexLines and FlexItems for a flex container's next-in-flows. r=dholbert https://hg.mozilla.org/integration/autoland/rev/dfd3e63d3371 Part 2 - Use FlexItemIterator to improve the performance when generating FlexLines and FlexItems for flex container's next-in-flows. r=dholbert https://hg.mozilla.org/integration/autoland/rev/2924b52f3b3f Part 3 - Setup NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER for flex container's next-in-flows. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Regressions: 1648577
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: