4 ms·
It's really easy to fuck up what will be evaluated, when, and wind up with disastrous performance ramifications. As an example, I wanted to accumulate a list o
by neutronicus 11y ago
It's really easy to fuck up what will be evaluated, when, and wind up with disastrous performance ramifications.
As an example, I wanted to accumulate a list of summary data as I iterated through a recursive function. Through a coding error, the elements of the list (although not the list itself) were not evaluated until all the iterations were complete. This meant that, instead of a list of structs, which I thought I had, I had a list of zero-argument functions that, when called, would yield structs, _each of which contained a reference to a large array computed at an earlier iteration of the computation_.
So, I hemorrhaged space. This was a fuck-up, not a missed optimization.