Use an RWMutex instead of a Mutex in PassRegistry

Alex Crichton alex at crichton.co
Thu Jun 27 00:27:38 PDT 2013


When using a LLVM's MCJIT from multiple threads, there was a huge
amount of contention in llvm::PassRegistry::getPassInfo. For the
particular suite of tests I was running, moving from a Mutex to an
RWMutex reduced the overall time from 6min to 20s. In both cases the
single-threaded case took about 40s (not all of this time is LLVM).

It basically seemed like it was a huge win for a small change, so yay!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rwmutex.diff
Type: application/octet-stream
Size: 3692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130627/73793878/attachment.obj>


More information about the llvm-commits mailing list