QmlProject: Don't use RegExp for simple wildcard matching
QRegExp matching is quite expensive, and has to be done for every file in the project directory tree against all possible suffixes. Optimize for the common case that the pattern is "*.suffix" by doing a fileName.endsWidth(suffix) in this case. This speeds up loading of examples/declarative/declarative.qmlproject by about 30%. Reviewed-by: Christian Kamm
Showing
- src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp 36 additions, 15 deletionssrc/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp
- src/plugins/qmlprojectmanager/fileformat/filefilteritems.h 3 additions, 0 deletionssrc/plugins/qmlprojectmanager/fileformat/filefilteritems.h
- tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp 32 additions, 2 deletions.../auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp
Loading
Please register or sign in to comment