A large number of custom emojis causes high CPU usage and timeouts when navigating directly to notices
When the instance has a large number of custom emojis (i.e. 1,000+) it causes high CPU usage when loading notices directly (e.g. opening the link in a new tab) as well as long response times and timeouts.
Strangely, no errors are recorded in the in the log.
How to reproduce:
Here's an archive of all of my emojis. If you extract all of that to instance/static/emoji
and then restart Pleroma you'll see that CPU usage is much higher and navigating to profiles and notices will take several seconds for Pleroma to respond or just timeout. It seems the effect is most pronounced in old notices from weeks or months ago which I suspect might be due to caching.
I think this might be the cause of #1153 (closed)