Skip to content

add @cache to freqent model info calls#64

Open
JoshCu wants to merge 2 commits into
NOAA-OWP:masterfrom
CIROH-UA:cache_bmi_funcs
Open

add @cache to freqent model info calls#64
JoshCu wants to merge 2 commits into
NOAA-OWP:masterfrom
CIROH-UA:cache_bmi_funcs

Conversation

@JoshCu
Copy link
Copy Markdown
Contributor

@JoshCu JoshCu commented Nov 26, 2025

while testing out some bmi code I noticed that certain functions to fetch model info are called by ngen every timestep and sometimes multiple times in a row.
This PR adds @cache to some of these functions
image

when running gage-10154200 (55 catchments) for 1 year with 6 ensembles:
runtime dropped from 33.619 s ± 0.157 s to 30.941 s ± 0.070 s

when running a single model (ensemble of 1)
14.093 s ± 0.110 s -> 11.436 s ± 0.175 s

Copy link
Copy Markdown
Contributor

@hellkite500 hellkite500 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.8 has been EoL for over a year now, I wouldn't go out of your way to ensure compatibility.

@JoshCu
Copy link
Copy Markdown
Contributor Author

JoshCu commented Nov 26, 2025

Python 3.8 has been EoL for over a year now, I wouldn't go out of your way to ensure compatibility.

time flies when you're having fun even 3.9 is EoL now, should probably move ngiab off it

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.

2 participants