There doesn't seem to be a need to support recursive locking,
and a recursive mutex is unnecessarily inefficient.
Details
- Reviewers
clayborg - Commits
- rG81b2fcf26fca: Use a non-recursive mutex in GsymCreator.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
710 ms | x64 debian > libomp.lock::omp_init_lock.c |
Event Timeline
GSYM conversion still spends a significant time for locking in GsymCreator::insertString even with only 8 threads, so lock contention seems to be generally an issue here. I was wondering if we could avoid locking the mutex here, but using thread-local tables until finalisation does not seem to be feasible since any thread might insert the same string IIUC and we want to have unique IDs at this point. A lock-free map might be an alternative here, though?
The "Copy" argument is usually set to "false" so it won't end up copying the string. We only have to back the string up if the DWARF information had no mangled name for an entry and we and up calculating a fully qualified name by traversing the DWARF. This is rare though.
I am open to ideas to speed things up, but many things rely on strings being correctly uniqued: strings for function names and inlined function names, files in the file tables (which consist of two string: directory + basename).
The "Copy" case might be rare, but the hash needs to be calculated regardless of whether "Copy" is true.
Or should I rather request commit access? I saw the other patch you landed now mentions you both as the author and the reviewer, which seems a bit odd.
I would go ahead and request commit access, but at least there is the Phabricator link in the commit that shows that you authored the diff. This is the main reason you want to get commit access, so you everyone can easily see who did the patches.