After making a few minor modifications to a function, I was surprised that my program went from a few hundred allocations to millions.
It turns out that even though I never used the return value of the function (the last line of the function was just pushing to a
StructArray), it was somehow impacting the performance of my program. Adding
nothing to the last line of the function cleared up all of the extra allocations.
Should I always be using
nothing when I don’t intend to use the return value of a function?