Skip to content

OccurrenceIter retry loop is expensive for degenerate rules #14

@eikopf

Description

@eikopf

Location

crates/gnomon-rrule/src/iter.rs:81-93

Description

If expand_period consistently returns empty (e.g., a rule that can never produce occurrences), the iterator tries 1000 consecutive periods before giving up. For sub-daily frequencies, this means ~1000 calls to expand_period.

While not a bug, this is a performance concern for malformed or degenerate recurrence rules.

Suggested Fix

Consider a configurable or frequency-aware retry limit, or validate upfront that the rule can produce occurrences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions