3 ms·
What does this solve? If you compute this lazily you’ll end up in a bunch of situations which require synchronisation primitives or you’d end up recomputing the
by heavenlyblue 7y ago
What does this solve? If you compute this lazily you’ll end up in a bunch of situations which require synchronisation primitives or you’d end up recomputing these value too many times.
Also the distance function can often be replaced by a distance to the power of two (since then the cost of running sqrt is not paid). This is often the case in my work - rearchitecting the application in such a way that you don’t need caching in the first place and being explicit.