Cache a KEmoticons instance here, not a KEmoticonsTheme.
Review Request #124878 - Created Aug. 22, 2015 and submitted
This already contains a cache for the theme, and it is expensive to create itself. Cuts down the cost in half here. Still not perfect though, the currentThemeName() call in theme() parses kdeglobals every time. And this is called per line for KMail's message rendering, resulting in more than 15% of the instructions spend in KConfig parsing code.
Callgrind + KMail.