Skip to content

Instantly share code, notes, and snippets.

@death
Created November 6, 2021 21:53
Show Gist options
  • Save death/9b9914c76866d32c7dc15c55cc05b526 to your computer and use it in GitHub Desktop.
Save death/9b9914c76866d32c7dc15c55cc05b526 to your computer and use it in GitHub Desktop.
optimization brag
[23:44] <@_death> https://i.imgur.com/hukQSMB.png
[23:44] <@_death> look at this beautiful thing
[23:45] <@_death> the oldest (last) entry in the first table is totally unoptimized.. see it takes
4.1s and allocates 123M
[23:46] <@_death> optimize, optimize, optimize..
[23:46] <@_death> see the second table.. it does the same work, but caches selectively..
[23:47] <@_death> in the unoptimized case, it suffers in both time and space
[23:47] <@_death> but then, at Gotcha, I got it to not allocate any memory, other than the caches
[23:49] <@_death> Gotcha used 5000 cache entries, so took about 2.4s and allocated 637K.. lowering
the number of cache entries, the time explodes exponentially, but memory
allocations are reduced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment