moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

painterResource is too slow on iOS

Open paxbun opened this issue 2 years ago • 5 comments

The MOKO resources version of painterResource is much slower than its JetBrains counterpart. For example,

LazyVerticalGrid {
    repeat(100) {
        item {
            // Too slow, the app freezes as the screen is scrolled
            Image(painterResource(MR.images.someImage))
            // Ok
            Image(painterResource("MR/images/[email protected]"))
        }
    }
}

It seems like retrieving images through UIImage, CGImage, and Skia Image conversions is too slow; why don't we just use the same strategy as in the JVM version (although the resource API is experimental)?

paxbun avatar Jul 10 '23 08:07 paxbun

For those who have the same problem, we modified MOKO resources as follows, and it works well. https://github.com/clebrain/moko-resources/blob/2cedf849eadd4be7f86ff7fa4ba2d6606bf15aa9/resources-compose/src/iosMain/kotlin/dev/icerock/moko/resources/compose/ImageResource.kt#L22-L59

image

paxbun avatar Jul 12 '23 07:07 paxbun

Hi @Alex009 is this has been released? I am also facing a similar issue on iOS.

DasJhaman avatar Sep 14 '23 08:09 DasJhaman

@DasJhaman no. it's planned in 0.24.0

Alex009 avatar Sep 14 '23 10:09 Alex009

@Alex009 Could you please provide an estimated timeframe for the release of version 0.24.0?

maqsats avatar Jan 04 '24 04:01 maqsats

@Alex009 Could you please provide an estimated timeframe for the release of version 0.24.0?

pcorreia89 avatar Feb 19 '24 02:02 pcorreia89

fixed in 0.24.0-beta-1

Alex009 avatar Apr 19 '24 15:04 Alex009