Disassembler: ContextCache is unperformant for multithreaded analysis #6649
Labels
Status: Internal
This is being tracked internally by the Ghidra team
Milestone
Is your feature request related to a problem? Please describe.
The code for
ContextCache.getWords
is shown below:As
SleighLanguage
is mapped one-one with aLanguageID
, so is the underlyingContextCache
. Thus anyDisassembler
returned bygetDisassembler(Language language,...)
will also go through the lock. This severely affects the performance of scripts that run multipleDisassembler
instances (or decompiler threads that may also need to disassemble) in parallel.Describe the solution you'd like
I'm deeply skeptical how much utility the
getWords
caching brings, but if it must be preserved I would recommend the use of a concurrent collection plus some size limit or an atomic. Otherwise I would simply do away with it altogether.Describe alternatives you've considered
Allow clones of the disassembler/sleighlanguage ? Or add bogus copies of each language ?
The text was updated successfully, but these errors were encountered: