diff options
author | aquayan <42374892+aquayan@users.noreply.github.com> | 2018-08-24 07:30:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 07:30:22 (GMT) |
commit | 0fc16d17963c50caa41959cc321d796a931aba44 (patch) | |
tree | 202aaa5cc53a5b9bd0966e679b7fe8714095569d /src/doxygen.cpp | |
parent | 94a52469b177703d3e0d94bed6c4a48bddba18cb (diff) | |
download | Doxygen-0fc16d17963c50caa41959cc321d796a931aba44.zip Doxygen-0fc16d17963c50caa41959cc321d796a931aba44.tar.gz Doxygen-0fc16d17963c50caa41959cc321d796a931aba44.tar.bz2 |
Update doxygen.cpp
Reading a few thousands of input CPP/H files in alphabetical order is very slow because of using the inSort construct. The inSort function does a linear loop through the list to find the right alphabetical position, leading to a quadratic algorithm. During the creation of the file list there is no need to keep it sorted - it is not used at all yet. Therefore I propose to just append them and to a final sort at the end of the creation of the file list.
For my use case with several thousands of input files, this reduces creating the file list from about an hour to a few seconds !!
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r-- | src/doxygen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index bf93a9b..ed3ffc9 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -9633,7 +9633,7 @@ int readDir(QFileInfo *fi, { fn = new FileName(cfi->absFilePath().utf8(),name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -9732,7 +9732,7 @@ int readFileOrDirectory(const char *s, { fn = new FileName(filePath,name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -10923,6 +10923,7 @@ void searchInputFiles() } s=inputList.next(); } + Doxygen::inputNameList->sort(); delete killDict; g_s.end(); } |