SDWebImageSwiftUI icon indicating copy to clipboard operation
SDWebImageSwiftUI copied to clipboard

How to improve performance ?

Open brightfuture opened this issue 3 years ago • 4 comments

i have about 20 WebImage in a lazy vgrid now the app janks a lot when scrolling i instrumented it and it shows WebImage was taking very long to draw

so is there a way to improve the performance ?

brightfuture avatar May 26 '21 12:05 brightfuture

I have exactly the same question :)

Is there a way to reduce the resolution of the image displayed ?

leogiroux avatar May 28 '21 10:05 leogiroux

@leogiroux i have cropped images to small size, and yet the issue is still there i think the problem is each WebImage has its own network module which is against SwiftUI's design principle to keep views light

i might have to eventually ditch this framework and just use Image instead

brightfuture avatar May 29 '21 14:05 brightfuture

"janks a lot" 🤣 I hope you made this up, because I'm stealing it. And I was just talking about this with a buddy. It would be nice if this library was updated to use the new Swift Concurrency features, it would be so smooth, @dreampiggy! There are a lot of things that the new AsyncImage cannot do, so it would be great if this library wrapped it.

Cyclic avatar Jul 17 '21 00:07 Cyclic

I'm just going to put out there that I was having this exact same issue. I have 2 LazyHGrids and 1 LazyVGrid on the same screen all loading images. I was getting a horrible framerate and CPU pegged at 100%. Decided to make a Release build to see what the performance would be like in production. Smooth as butter, CPU sitting at around 2-3% unless the user is scrolling, but it never goes above 50%. So this seems to be a Debug-mode related issue with LazyV/HGrid and likely has nothign to do with SDWebImage

metsfan avatar Aug 03 '21 02:08 metsfan