[llvm] Reduce llvm-gsymutil memory usage (lambda-free, and less locking) (PR #97640)

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 16:37:06 PDT 2024


kevinfrei wrote:

> Hmm, now this is a bit simpler - how bad would it be if it indirected through the DWARFContext & used the existing context-level locking? (perhaps it's a losing battle to try to avoid the threading complexity leaking out of the ThreadSafeDWARFContext, but I'll at least ask)
> 
> Like if DWARFContext had a somewhat awkward "doThisThingThreadSafely(function_ref<void()>)" and these APIs called that, which held the lock and did the work (or with the non-thread-safe DWARFContext, just called back immediately)

That makes my inner grumpy-old-man want to start yelling about kids-these-days doing crazy-things.

So the user needs to know if they're operating in a thread-safe environment or not, and has to make sure that anything being called is also thread-safe. That seems *super* dangerous. That said, I feel like you're concerned about single-threaded performance of this code, but from what I've seen it's *over the top* IO bound. Given your experience in the codebase, I'm gonna go try to see if I can do what you're describing, but I'd _really_ appreciate more color regarding why you're so worried about the performance of this single lock. I feel like I'm missing some scenario that should be more obvious to me.

https://github.com/llvm/llvm-project/pull/97640


More information about the llvm-commits mailing list