add @cache to freqent model info calls#64
Open
JoshCu wants to merge 2 commits into
Open
Conversation
hellkite500
reviewed
Nov 26, 2025
Contributor
hellkite500
left a comment
There was a problem hiding this comment.
Python 3.8 has been EoL for over a year now, I wouldn't go out of your way to ensure compatibility.
Contributor
Author
time flies when you're having fun even 3.9 is EoL now, should probably move ngiab off it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
when running gage-10154200 (55 catchments) for 1 year with 6 ensembles:
runtime dropped from
33.619 s ± 0.157 sto30.941 s ± 0.070 swhen running a single model (ensemble of 1)
14.093 s ± 0.110 s->11.436 s ± 0.175 s