hass.tibber_prices/custom_components/tibber_prices/interval_pool
Julian Pawlowski 8f05f8cac7 perf(interval_pool): hoist fetch_groups and precompute period criteria
- Move UTC import from inline (inside _has_real_gaps_in_range) to
  module-level in manager.py
- Hoist get_fetch_groups() out of while loop in _get_cached_intervals:
  eliminates ~384 function calls per invocation
- Pre-compute criteria_by_day dict in build_periods before the for-loop:
  eliminates ~381 redundant NamedTuple constructions per call; only
  ref_price/avg_price vary by day (max 3 entries), flex/min_distance/
  reverse_sort are constant throughout

Impact: Reduces unnecessary object creation during the hot paths called
every 15 minutes and during all relaxation phases.
2026-04-06 14:35:33 +00:00
..
__init__.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
cache.py fix(interval_pool): prevent external mutation of cached intervals 2025-12-23 14:13:24 +00:00
fetcher.py fix(interval_pool): use tz-aware datetime comparison at resolution boundary 2026-04-06 14:08:27 +00:00
garbage_collector.py fix(interval_pool): prevent external mutation of cached intervals 2025-12-23 14:13:24 +00:00
index.py refactor(interval_pool): improve reliability and test coverage 2025-12-23 10:10:35 +00:00
manager.py perf(interval_pool): hoist fetch_groups and precompute period criteria 2026-04-06 14:35:33 +00:00
routing.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
storage.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00