Re: [Doxygen-develop] Doxygen Performance Issues and Solutions
Brought to you by:
dimitri
From: Dimitri V. H. <do...@gm...> - 2012-03-10 20:13:51
|
Hi Dirk, On Mar 8, 2012, at 19:01 , Dirk Reiners wrote: > > Hi All, > > we've been struggling with doxygen's performance for a while. Generating the docs for our project (OpenSG) with the stock 1.7.4 on F14 takes about 10 hours (and that's without using dot). > > So I ran the whole thing through cachegrind (don't ask me how long that took ;) and I found a few hotspots. The biggest one by far were the isAccessibleFrom and isAccessibleFromWithExpScope functions in util.cpp. They use a QDict for storing results, which requires building a string for the key every time a test is made, which is very slow. I replaced that with a little struct and the QDict with an std::vector (it is really just used as a stack), which gave a significant speed boost. > > I also tried adding a cache to isAccessibleFrom, but that had some problems (it needed to be flushed a few times during the process, and I'm not sure exactly why or if I got all cases), and it did not make a very big difference in the end. It's in there, but it's easy to take out (search for USE_ISACCESSIBLEFROM_CACHE in utils.cpp and the clearIsAccessibleFromCache(); calls in doxygen.cpp). > > The other big one was the creation of the PNG files for the class diagrams etc. The images doxygen creates are pretty simple and have long single color runs. On these images the brute force encoder (which is still in the code) runs quite a bit faster than the smart one that is used by default. To make things even better I added some special case code that explicitly tries to find single color runs and quickly encodes them. The resulting PNGs are slightly larger than the original ones, but the encoding is noticeably faster. > > With my patches on top of the latest SVN the time goes down to ~70 minutes, or an order of magnitude less, which is still not really fast but a lot more reasonable, IMHO. :) These are pretty impressive results! I'll see how I can best integrate your patch. Regards, Dimitri |