improve threading
- use a worklist approach => better spreading of search work
- use idea thread count for number of runnables => higher parallelism
- avoid that the QRegularExpression is shared between threads (without this, e.g. 16 vs. 2 threads is no real difference)
- deactive qmimedb atm => creates QRegularExpression internally => leads to same locking hell :/
with this, in a linux.git clone, searching for Linus takes:
- with 2 threads: ~4.5 seconds
- with 16 threads: ~0.5 seconds :P
I would call that "blazing xxxxxxx fast".
We need a workaround for the mimedb, it makes it useless, then you are back to multiple seconds.
Btw., perf did show the locking mess.
Really just without the
m_regExp(regexp.pattern(), regexp.patternOptions()) // we WANT to kill the sharing, ELSE WE LOCK US DEAD!
line, you can't really get any benefit over the 2 threads, even on my 16 core machine (with a SSD fast as hell).
Edited by Christoph Cullmann