From 0fc16d17963c50caa41959cc321d796a931aba44 Mon Sep 17 00:00:00 2001 From: aquayan <42374892+aquayan@users.noreply.github.com> Date: Fri, 24 Aug 2018 09:30:22 +0200 Subject: 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 !! --- src/doxygen.cpp | 5 +++-- 1 file 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(); } -- cgit v0.12