Skip to content

Performance enhancement: NEX-GDDP fetch pipeline (review + next steps) #131

Description

@Sammyjoseph999

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:

  1. 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).
  2. 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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions