Skip to content

Composing Or filters as an imbalanced tree causes signficialy longer build times #619

@shesek

Description

@shesek

In a project I'm working on, I was able to cut debug build times by ~65%, from 6 minutes to 2 minutes, by building a more balanced Or tree of filters. Note that I optimized this code for readability and did not make the tree as balanced as it could be, an optimally balanced tree should yield even better results.

It might be useful to others it this was documented somewhere. Another thing that could make things easier is for warp to provide an or! macro that takes a flat list of filters and automatically builds an optimally balanced tree for them, in a way that preserves the filters order priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions