Laziness is better when it's visible. http://www.drmaciver.com/2017/03/laziness-is-better-when-its-visible/ … A data structure representation trick that seems weirdly under-used.
-
-
Replying to @DRMacIver
It's quadratic because each time you append you reallocate the result string?
1 reply 0 retweets 0 likes -
-
Replying to @DRMacIver @AshBerlin
Presumably it allocates to a factor of current capacity, not absolute minimum bytes required?
1 reply 0 retweets 0 likes -
Replying to @sgrif @AshBerlin
No, because you're concatenating immutable buffers so each allocation is an entirely new copy of all the data.
2 replies 0 retweets 0 likes
Replying to @DRMacIver @AshBerlin
Ah, my bad. I thought the point was meant to be more general.
9:48 AM - 6 Mar 2017
from Ottawa - Gatineau
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.