Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vertical fluxes all at once #1433

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Update vertical fluxes all at once #1433

merged 1 commit into from
Apr 29, 2024

Conversation

visr
Copy link
Member

@visr visr commented Apr 28, 2024

When doing a profile of the HWS model I saw this line take 25-40% of the time:

vertical_flux = get_tmp(vertical_flux, storage)

I seems like PreallocationTools doesn't like get_tmp on ComponentArrays, because that call led to the array being copied, leading to lots of allocations. This works around this issue by calling this once per timestep rather than once per timestep for each Basin. Perhaps this can still be fixed rather than worked around, though I think this refactor makes sense anyway.

@visr visr added the performance Relates to runtime performance or convergence label Apr 28, 2024
Copy link
Collaborator

@SouthEndMusic SouthEndMusic left a comment

Choose a reason for hiding this comment

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

All good

@visr visr merged commit 2b80dfe into main Apr 29, 2024
24 checks passed
@visr visr deleted the vert-perf branch April 29, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Relates to runtime performance or convergence
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants