Skip to content

perf(eval): optimize holidays collection and contains check in date functions#102

Merged
PSU3D0 merged 1 commit into
mainfrom
perf/holiday-lookup-optimization
May 20, 2026
Merged

perf(eval): optimize holidays collection and contains check in date functions#102
PSU3D0 merged 1 commit into
mainfrom
perf/holiday-lookup-optimization

Conversation

@PSU3D0
Copy link
Copy Markdown
Owner

@PSU3D0 PSU3D0 commented May 20, 2026

Summary

  • Optimize holiday collection from RangeView by iterating directly over non-null values in numbers_slices to avoid allocating LiteralValue cell elements.
  • Sort and deduplicate the collected holidays once at the end of collection.
  • Replace $O(H)$ linear .contains(&date) scans inside the date loops of NETWORKDAYS and WORKDAY (and their .INTL variants) with $O(\log H)$ binary searches.

Validation

  • cargo fmt --all -- --check
  • cargo test -p formualizer-eval --lib datetime::weekday_workday
  • verified with new unit test networkdays_collects_sorted_deduped_holidays

@PSU3D0 PSU3D0 force-pushed the perf/holiday-lookup-optimization branch from 282885c to a808332 Compare May 20, 2026 00:43
@PSU3D0 PSU3D0 merged commit 5baf8d8 into main May 20, 2026
6 checks passed
@PSU3D0 PSU3D0 deleted the perf/holiday-lookup-optimization branch May 20, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant