Skip to content

Optimize IntervalUnion.plus when both lower and upper are partially impacted #43

@Whathecode

Description

@Whathecode

Most plus cases are optimized to limit iteration over all intervals contained in a union. E.g., if the interval to add fully encompasses an IntervalUnion, there is no need to consider the underlying nodes.

However, when a plus operation results in both the lower and upper component partially being impacted, the underlying nodes need to be considered. And, since both branches of the node are impacted, this couldn't easily be solved through delegating recursively to one of the two branches.

Instead, a quick naive fold is implemented for all intervals in the upper component after recursively resolving lower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementPerformance or refactoring improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions