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

Remove unneeded state from Runge-Kutta stepper #871

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

stephenswat
Copy link
Member

Currently, the Runge-Kutta stepper holds a lot of state which is used only internally. The size of this state is 164 bytes, of which only 140 bytes are needed after the step. Keeping the remaining state between steps is therefore taking up a lot of memory.

In this PR, I remove this internal state from the externally facing stepper state and turn it into an intermediate struct which is not stored persistently, saving 140 bytes on the size of the stepper state (and, with it, the propagator state).

@stephenswat stephenswat added the refactor refactoring the current codes label Oct 25, 2024
@stephenswat stephenswat force-pushed the refactor/shrink_rk_state branch 2 times, most recently from 554f470 to 1f22b6b Compare October 25, 2024 15:10
@beomki-yeo
Copy link
Collaborator

beomki-yeo commented Oct 25, 2024

Yeah I think this should increase the performance. You can also roughly measure the performance change by running the benchmark executable

@stephenswat stephenswat force-pushed the refactor/shrink_rk_state branch 3 times, most recently from 27faa83 to 0178c3c Compare October 28, 2024 15:49
stephenswat added a commit that referenced this pull request Oct 30, 2024
This resolves the internal compiler error in #871.
Copy link
Contributor

@niermann999 niermann999 left a comment

Choose a reason for hiding this comment

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

Looks good as far as I can tell

Currently, the Runge-Kutta stepper holds a lot of state which is used
only internally. The size of this state is 164 bytes, of which only 140
bytes are needed after the step. Keeping the remaining state between
steps is therefore taking up a lot of memory.

In this PR, I remove this internal state from the externally facing
stepper state and turn it into an intermediate struct which is not
stored persistently, saving 140 bytes on the size of the stepper state
(and, with it, the propagator state).
Copy link

sonarcloud bot commented Nov 1, 2024

@stephenswat stephenswat merged commit 309ca41 into main Nov 1, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor refactoring the current codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants