> On 21. Dec 2018, at 11:40, Orgad Shaneh <org...@gmail.com> wrote:
> 
> Hi,
> 
> Building the project tree for qtcreator.pro takes about 5 seconds, on which 
> the GUI is blocked.
> 
> I profiled setRootProjectNode(QmakeNodeTreeBuilder::buildTree(this)) in 
> QmakeProject, and found out that mimetype resolving is the heaviest operation 
> there.
> 
> Is it possible to cache mimetype results? Or at least have a cache for common 
> extension such as cpp/cxx/c/h/hxx?

Looks like the fast lookup (lookup of file extension in hash) is only done for 
glob patterns with weight == 50 (see  MimeAllGlobPatterns::matchingGlobs, the 
part involving m_fastPatterns), but it even then has to look through all the 
patterns that do not only consist of an extension There might be a pattern 
“Foo*.hxx” with a different mime type than for “*.hxx”.

MimeGlobPatternList::match also seems to first try to match a glob to the file 
name, but then  MimeGlobMatchResult::addMatch throws a match away if that has a 
lower weight than a previous match.

So some things in the mime database itself could probably be optimized (changes 
should be synced with Qt QMimeDatabase though.)

But I’d say that the project tree usually doesn’t need the accuracy that is 
generally expected by the mime database. What does it use the mime type for 
anyhow?

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
eike.zil...@qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 
144331 B

_______________________________________________
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator

Reply via email to