Version: kdevelop-031003 snapshot (using KDE KDE 3.1.4) Installed from: Gentoo Packages Compiler: gcc-3.2.3 When building a large project (with sources that take some time to compile), the entire application slows to a crawl. This is on a dual processor system and make is running with -j 1. Selecting "stop" from the build menu has no effect, the build continues to run. I didn't build kdevelop with a lot of debugging info, but I attached to it with gdb and saw that it was spending a LOT of time parsing output from the make child process. This doesn't seem to account for the total lack of response in the main application, or the failure of the make widget to accept the signal sent by selecting "stop" from the build menu. As the build progresses, the responsiveness degrades.
I rebuilt from CVS head as of Oct 9 using -O0 -g3 -pg to start tracking this down. A LOT of time is spent (> 20 seconds) in matchEnterDir and matchLeaveDir parsing input from the child make process. The offending call in matchEnterDir is if (dirChange.search(line) > -1 ) where dirChange is defined as: static QRegExp dirChange(QString::fromLatin1(".*: (.+) (`|") + QChar(0x00BB) + QString::fromLatin1(")(.*)('|") + QChar(0x00AB) + QString::fromLatin1(")(.*)")); and a similar call in matchLeaveDir. The input line is large (631 bytes, lots of include directives sent to the compiler). So, in addition to slowing down the UI, the build is also crippled. My regex-foo is pretty weak, so I don't know if this is a problem with the regex or the implementation of QRegExp::search.
After further examination of the regex, it would be MUCH better to use a strict regex once for each language searching for enter/leave directory. It looks like the regex costs nearly O(N!). For input that is several hundred characters in length, this is unacceptably slow.
This is 100% reproducable by adding a ton of -Iblah to INCLUDES in the kdevelop project itself. The larger INCLUDES becomes, the worse kdevelop performs. So, the more input the "directory change" parser(s) see, the worse kdevelop performs, slowing the build and halting any interaction with the UI. affected code: parts/outputviews/directorystatusmessagefilter.cpp:84 (regex declaration in DirectoryStatusMessageFilter::matchEnterDir) and parts/outputviews/directorystatusmessagefulter.cpp:151 (other regex declaration in DirectoryStatusMessageFilter::matchLeaveDir)
Created attachment 2729 [details] This patch fixes extremely poor performance (> 20 second hangs) in directory enter/leave parsing when scanning large strings. QString finds are first performed against the input line to avoid the very expensive QRegExp::search. In testing, there was no noticable slowdown compared to the previous version, and it dramatically improved performance in cases where the input line was large (always a case that never involved directory enters/leaves anyway).
patch appyed. 'OKed' by adymo. Is this bug now fixed?
Subject: Re: make for large projects halts main application UI On Saturday 18 October 2003 06:07 am, you wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > You are on the CC list for the bug, or are watching someone who is. > > http://bugs.kde.org/show_bug.cgi?id=65659 > > > > > ------- Additional Comments From dhdev@gmx.de 2003-10-18 13:07 ------- > patch appyed. 'OKed' by adymo. > Is this bug now fixed? I'm going to rebuild with the latest CVS (which looks fixed), retry my test case, and if all goes well, close this bug. Thank you for accepting my patch! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/kV64VNfzd40u7PwRAn0kAKCGq7mqb4p50pFyD/aD/YFmFL90xgCeLttV tnv/MBHOmIAassUnrUXgKSo= =bg2s -----END PGP SIGNATURE-----
Subject: Re: make for large projects halts main application UI On Saturday 18 October 2003 06:07 am, Dominik Haumann wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > You are on the CC list for the bug, or are watching someone who is. > > http://bugs.kde.org/show_bug.cgi?id=65659 > > > > > ------- Additional Comments From dhdev@gmx.de 2003-10-18 13:07 ------- > patch appyed. 'OKed' by adymo. > Is this bug now fixed? The latest CVS (as of 18 Oct 2003) does not build. I cannot verify this fix. It fails building qextmdi in kdockwidget_compat.h looking for QT headers. I have not changed my build environment. I re-ran the bootstrap procedure, reconfigured, ran make clean, and make. make[3]: Entering directory `/home/logic/downloads/kdevelop/lib/qextmdi' g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -march=athlon-mp -mcpu=athlon-mp -O6 -pipe -mmmx -msse -m3dnow -mfpmath=sse -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT kdockwidget_compat.moc.cpp -o kdockwidget_compat.moc In file included from kdockwidget_compat.moc.cpp:11: kdockwidget_compat.h:30:20: qpoint.h: No such file or directory -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/kYLWVNfzd40u7PwRAi79AJ9z0rLS+GhlQGV30wIUeUYdJCooXwCfd30E lfY8ax94ljqREBgLr5dsnkc= =Svsn -----END PGP SIGNATURE-----
*** Bug has been marked as fixed ***.