Skip to content

improve threading

Christoph Cullmann requested to merge work/improve_threading into master
  1. use a worklist approach => better spreading of search work
  2. use idea thread count for number of runnables => higher parallelism
  3. avoid that the QRegularExpression is shared between threads (without this, e.g. 16 vs. 2 threads is no real difference)
  4. deactive qmimedb atm => creates QRegularExpression internally => leads to same locking hell :/

with this, in a linux.git clone, searching for Linus takes:

  1. with 2 threads: ~4.5 seconds
  2. with 16 threads: ~0.5 seconds :P

I would call that "blazing xxxxxxx fast".

@dhaumann @waqar @sars

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

Merge request reports