Skip to content

Reduce number of Vecs allocated in perform_absolute_layout_on_absolute_children #167

@TimJentzsch

Description

@TimJentzsch

What problem does this solve or what need does it fill?

Reduce number of Vecs generated in perform_absolute_layout_on_absolute_children in the flexbox algorithm:

taffy/src/flexbox.rs

Lines 1404 to 1410 in e75a55f

// TODO: remove number of Vec<_> generated
let candidates = self.children[node]
.iter()
.cloned()
.enumerate()
.filter(|(_, child)| self.nodes[*child].style.position_type == PositionType::Absolute)
.collect::<Vec<_>>();

What solution would you like?

Whatever works best regarding the benchmarks.

What alternative(s) have you considered?

We can leave it as-is.

Additional context

This should be implemented (or at least merged) after #128 such that we can assess whether the changes actually improve performance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions