Skip to content
Commit 5c67406c authored by Milian Wolff's avatar Milian Wolff
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment