Reduce memory usage in toc
Submitted by Brent Smith (smitten)
Link to original bug (#339496)
Description
Yelp processes the data/{toc.xml,man.xml,info.xml} file using stylesheet/toc2html.xsl. This file has a little more than 1KB in CSS data specified at the top of the file. Since yelp creates a YelpPage for each toc category, this 1KB of data gets duplicated in memory. With around 50 categories this leads to around 60KB of in memory data that could be avoided if we just include a link to a CSS stylesheet on disk.
Note that there are some dynamic values that are passed in to the stylesheet, so those are kept in the toc2html.xsl stylesheet.
Of course, moving to the YelpDocument api will give us the ability to do on-demand page loads (for the TOC at least), and we won't have to store all the toc pages in memory, which will save us a lot more memory.
The patch will follow shortly.
Version: git master