Skip to content

Add prepare-stage timing logs to diagnose WindInterpolation bottlenecks - #8

Draft
KULcoder wants to merge 1 commit into
data-pvlib-integrationfrom
codex/investigate-performance-of-prepare-function
Draft

Add prepare-stage timing logs to diagnose WindInterpolation bottlenecks#8
KULcoder wants to merge 1 commit into
data-pvlib-integrationfrom
codex/investigate-performance-of-prepare-function

Conversation

@KULcoder

Copy link
Copy Markdown
Owner

Motivation

  • Investigate and pinpoint where prepare() spends time for the WindInterpolationModel, with suspicion around file I/O.
  • The likely hotspots are input aggregation via xr.open_mfdataset, spline coefficient computation in _splrep/scipy.make_interp_spline (including any dask map_blocks activity), output writes via xr.save_mfdataset, SHA256 hashing of outputs, and metadata dump.

Description

  • Instrumented BaseModel.prepare with time.perf_counter() measurements and logger.info messages that report elapsed time per year/month for: open_mfdataset, _prepare_dataset, result.register, and result.dump.
  • Added import time and placed timers around the with-block that opens the reference files, the call to _prepare_dataset, the result.register call, and the final result.dump step.
  • No behavioral or output format changes were introduced; this is logging-only diagnostic instrumentation intended to reveal whether slowness is I/O- or compute-bound.

Testing

  • Ran python -m compileall src/geodata/model/_base.py and the file compiled successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant