2 ms·
> I set a rule for myself that I'll spend up to one minute trying to save an allocation. Beyond that it's not worth getting sidetracked. My rule is that I'll d
by marcosdumay 4y ago
> I set a rule for myself that I'll spend up to one minute trying to save an allocation. Beyond that it's not worth getting sidetracked.
My rule is that I'll do what is the easiest, unless it's an inner loop that runs all the time, where I'll try to make it fast.
In rust, usually the easiest is to not allocate or copy data. When it's easier to allocate or copy, I don't do a cost-benefit analysis at all, I just do it.