A couple issues/observations related to performance:
1. Images with alpha channel render slowly, the old sxiv code seems to work around it by using a separate image for the alpha and then blending the actual image onto it. From some small testing this resulted in about a 2x improvement on my machine. Here's the [[ https://github.com/nsxiv/nsxiv/blob/c6275374b03ac4526a46f255f33ae2f81003d52b/image.c#L625-L655 | code-snippet for it.]]
2. Scaling without anti-aliasing seems to have a pretty big hit on performance as well. About 13x slower compared to no scaling.
3. Scaling _with_ anti-aliasing is even slower. About 40x slower compared to no scaling.
I discovered these while trying to investigate a [[ https://github.com/nsxiv/nsxiv/issues/70 | bug report on nsxiv ]] about multi-frame image animation slowing down when zoomed in. As far as I can tell, the culprit here is scaling+aa. Although, I do think that there's room for optimizing how we render animated images on our end, so I'll look into that.
However that brings me to another question, what's Imlib2's stance on multi-frame images? Is there any plans for adding an api for dealing with multi-frame/animated images?