GNOME Bugzilla – Bug 339496
Reduce memory usage in toc
Last modified: 2018-05-22 12:41:03 UTC
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.
Created attachment 64165 [details] [review] patch to move CSS style definitions to toc.css file
This actually doesn't seem to reduce the heap size but increases it by about 2M! The mozilla library might be initializing some CSS functions now that it wasn't before, therefore I'm putting this patch on hold till I can make more sense of this.
Marking patch as "needs-work" in line with smittens comment.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/yelp/issues/12.