Performance enhancement: NEX-GDDP fetch pipeline
@peetmate — assigning to you to review the NEX-GDDP performance work and assess further enhancement opportunities.
Background
The NEX-GDDP ensemble/analysis paths were slow because they fetched data one year at a time and ran models serially. A series of changes introduced two optimizations across the ensemble modules:
- Span-fetch — fetch the full date range once per (model, scenario) in a single GEE call, then slice per year in memory (was one GEE call per year).
- Parallelism — run the per-model/per-projection work concurrently via
ThreadPoolExecutor, auto-scaled by default (--workers, capped at 10 to match the GEE connection pool). The season-analysis ensemble stays serial (its global monkeypatch/redirect_stdout is not thread-safe) but still benefits from span-fetch.
Measured impact
- Long-term climatology (16 models x 2 scenarios x 30 years): >15 min -> ~2 min.
- Ensemble hazards (640 projections): GEE calls 640 -> 32, fetch wall-clock ~3 min.
- Season analysis: ~21x fewer GEE fetches per model (one span vs one per year).
Associated commits / PRs (flagged for review)
Affected modules: calculate_hazards/ensemble_hazards.py, climatology/long_term_climatology.py, climate_statistics/ensemble_statistics.py, compare_periods/ensemble_periods.py, season_analysis/ensemble.py, season_analysis/seasons.py.
For Pete to assess
- Whether the worker cap (10) is optimal vs GEE quota/rate limits, and whether the season-analysis ensemble can be made safely parallel (remove the global monkeypatch in
analyze_one_model).
- Caching repeated (model, scenario, location) fetches across runs.
- Any remaining per-year or per-call hot spots in the GEE path (
fetch_data/source_data/sources/gee.py, nex_gddp.py).
Performance enhancement: NEX-GDDP fetch pipeline
@peetmate — assigning to you to review the NEX-GDDP performance work and assess further enhancement opportunities.
Background
The NEX-GDDP ensemble/analysis paths were slow because they fetched data one year at a time and ran models serially. A series of changes introduced two optimizations across the ensemble modules:
ThreadPoolExecutor, auto-scaled by default (--workers, capped at 10 to match the GEE connection pool). The season-analysis ensemble stays serial (its global monkeypatch/redirect_stdoutis not thread-safe) but still benefits from span-fetch.Measured impact
Associated commits / PRs (flagged for review)
061d5c0,2100efb)e3e4e8b,9ec82c0)389b912)--workersflags (c9c9c2f)c96ab94)Affected modules:
calculate_hazards/ensemble_hazards.py,climatology/long_term_climatology.py,climate_statistics/ensemble_statistics.py,compare_periods/ensemble_periods.py,season_analysis/ensemble.py,season_analysis/seasons.py.For Pete to assess
analyze_one_model).fetch_data/source_data/sources/gee.py,nex_gddp.py).