Often the context is just 2 vertices, so it's not worth allocating large arrays to create the Weld context.
Resize the arrays in the end so that memory is better used in other areas.
Differential D13622
Weld modifier: Decrease memory usage Authored by Germano Cavalcante (mano-wii) on Dec 18 2021, 11:28 PM.
Details
Often the context is just 2 vertices, so it's not worth allocating large arrays to create the Weld context. Resize the arrays in the end so that memory is better used in other areas.
Diff Detail
Event Timeline
Comment Actions I am not familiar with this code, but if you are looking at reducing memory, have you tried switching to pre-increment instead of post-increment, to make sure you aren’t making a copy and destroying it every loop, in the cases that the compiler is unable to optimize away? Comment Actions ++i vs i++ and possibly ++wvert_len vs wvert_len++ for example. Take the suggestion with a large grain of salt, as I just found out about post increment creating a copy of the value before increasing the value and returning the copy, and I don’t fully grasp where preincrement isn’t applicable. Sources: https://herbsutter.com/2013/05/13/gotw-2-solution-temporary-objects/ | ||||||||||||||||||