Skip to content

Welcome dialog template list: Avoid loading icons twice

Max Gaukler requested to merge mgmax/inkscape:speedup-templateicons into master

Rendering the SVG icons of templates in the startup screen is a huge bottleneck in the startup time. (ca. 1-2 seconds out of total 6 seconds).

Currently we have 91 templates but only 37 distinct icons. Currently, we still make 91 rendering calls. This MR cuts the rendering time in half by rendering each file only once and then caching the result in RAM. This saves ca. 0.5-1 second of startup time.

For the timing measurement method see !6311 (merged) .

Relative CPU usage of TemplateList::init is now down from 20% to 10%. It is still the largest single bottleneck regarding startup time, even after this MR. It would be great if someone picks this up and extends it to file-based caching.

Please review carefully. My C++ knowlege is limited, I may have added pointer leaks or similar evil stuff that you could never produce in Python...

Edited by Max Gaukler

Merge request reports