A couple issues/observations related to performance:
- 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 code-snippet for it.
- Scaling without anti-aliasing seems to have a pretty big hit on performance as well. About 13x slower compared to no scaling.
- Scaling _with_ anti-aliasing is even slower. About 40x slower compared to no scaling.
I discovered these while trying to investigate a 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?