optimize: only use ForegroundLock in ParseJob::readContents when really required
We now use a variant of the double-checked-initialization pattern, as the trackerForUrl should be threadsafe according to its apidox. Only when we have a tracker do we need to get the foreground lock. When opening a project, the majority of files won't be opened in the editor, and all others can thus be parsed/read without requiring a ForegroundLock In my benchmarks (using the free non-commercial edition of VTune) this improved the performance of a duchainify run by 25% or ~10s. CCBUG: 215968
parent
c23788c1
Please register or sign in to comment