3 ms·
Can someone explain slides 54-58, about how it takes many minutes to lowercase strings? slide 55 reads: "each string operation takes 21 seconds" (an amount of
by logicallee 9y ago
Can someone explain slides 54-58, about how it takes many minutes to lowercase strings?
slide 55 reads: "each string operation takes 21 seconds" (an amount of time which I translate conservatively into tens of billions of operations or gigabytes of in-memory lookups).
How can performance be that bad - I would think it's trivial? Like, I'm not getting what lowercasing can possibly be doing that is so resource intensive. Any ideas?
- golangnews 9y agoLooks like the output of pprof, so perhaps the slide means all calls to this function (when run 10000 times say during checking dependencies over a very large codebase), take 21 second in total, reduced to 4 seconds by storing the results of comparisons in a map and using that instead. Go strings are immutable so calling ToLower repeateadly would copy them each time.