While working on this I noticed that image cache, while used with images from filesystem, results in almost no speedup. I would expect the images to be cached in RAM, but it seems only the files descriptors are cached and the files left open. The cache life value is also calculated only based on open (link).
I’ve implemented my own simple cache that caches whole images in SPIRAM
and got much better results.
Wouldn’t it be better change this behavior of the built-in image cache feature?
The purpose of image caching is not to speed up loading binary images from files. But e.g. to save the time of decoding png images. However it’d be possible to add a custom image decoder that loads the whole image into RAM.