2 ms·
One of the interesting side effects of this style is that you sometimes choose to let code run slower than it could, and choose to use more memory than you need
by dahart 10y ago
One of the interesting side effects of this style is that you sometimes choose to let code run slower than it could, and choose to use more memory than you need.
The point is (as you say) to make all loops & allocation as predictable as possible, so when you make them fixed size, you have to fix it on the worst case. Ideally there is no worst case, and the amount of work you do per frame or cycle is constant. But for anything non-trivial, chances are fixed allocations & loops aren't always needed, even though they're extremely useful.
This does exactly what you say, in my experience: it makes performance eyeball-able, you can see where problems are. Code becomes so easy to reason about that debugging is easier and time is saved.