Skip to content

Conversation

@timothy-nunn
Copy link
Contributor

@timothy-nunn timothy-nunn commented Oct 7, 2025

Removes expensive deepcopies of profile objects.

The following table shows the % of the runtime for a 60 iteration example evolutive run that is spent deep copying objects.

Linear Non-linear
main (10615f0) $11.17$% $5.82$%
This PR $8.30$% $<1$%

Overall, this results in a reduction in runtime spent in stepping.nlstepper (linear evolutive example): going from $21.12$% on main to $16.96$% on this branch.

Note this PR will combine with #43 to remove the bulk of the overhead of copying objects.

I have compared history arrays of the coil currents, o-points, elongation, triangularity, squareness, separatrix area, and separatrix length between main and this PR. There is a 0 MAE between the non-linear example histories on main and in this PR, and a 0 MAE between the linear histories on main and in this PR.

I have confirmed that example 01, 02, 03, 04, 05, 09, and 10 can run on this branch and produce the same results as on main (the example are all non-deterministic because the RNG is not seeded but they are qualitatively similar to examples as run on main)

@timothy-nunn timothy-nunn force-pushed the remove-deepcopying-profiles branch from 6a5de47 to fe1bb36 Compare October 7, 2025 16:13
@timothy-nunn timothy-nunn force-pushed the remove-deepcopying-profiles branch 3 times, most recently from c752ef1 to d5e4723 Compare October 9, 2025 14:34
@timothy-nunn timothy-nunn force-pushed the remove-deepcopying-profiles branch from d5e4723 to ea6aaee Compare October 10, 2025 07:52
@timothy-nunn timothy-nunn marked this pull request as ready for review October 10, 2025 07:53
@kpentland kpentland added enhancement New feature or request ready-for-final-tests Pull request is ready to run final pre-merge tests and removed ready-for-final-tests Pull request is ready to run final pre-merge tests labels Oct 10, 2025
@kpentland kpentland removed the ready-for-final-tests Pull request is ready to run final pre-merge tests label Oct 10, 2025
@timothy-nunn timothy-nunn force-pushed the remove-deepcopying-profiles branch from 79b0303 to 39cbd9c Compare October 10, 2025 11:54
@kpentland kpentland added the ready-for-final-tests Pull request is ready to run final pre-merge tests label Oct 10, 2025
@kpentland kpentland added ready-for-final-tests Pull request is ready to run final pre-merge tests and removed ready-for-final-tests Pull request is ready to run final pre-merge tests labels Oct 10, 2025
@kpentland
Copy link
Collaborator

This is excellent, thanks again Tim! I've been through and had no trouble on my end (barring the small commits made above). Ready to merge!

@kpentland kpentland merged commit 22ab56e into FusionComputingLab:main Oct 10, 2025
2 checks passed
@timothy-nunn timothy-nunn deleted the remove-deepcopying-profiles branch October 10, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-final-tests Pull request is ready to run final pre-merge tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants