Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Gifs are laggy #118

Open
Im-Fran opened this issue Oct 15, 2022 · 5 comments
Open

[Bug]: Gifs are laggy #118

Im-Fran opened this issue Oct 15, 2022 · 5 comments
Labels
ui User interface-related issues

Comments

@Im-Fran
Copy link
Contributor

Im-Fran commented Oct 15, 2022

Describe the Bug

Bug Description
The gifs that are shown are laggy, and even more when viewing a folder.

Reproducing the Bug

  1. Hover a gif
  2. See the lag

Version

0.5.1 (Build 15)

Category

Media (images, audio, video etc.)

Relevant Log Output

No response

Screenshots

This is from Official Discord:

This is from SwiftCord

Additional Info

No response

@Im-Fran Im-Fran added bug Something isn't working triage Waiting for this issue to be triaged labels Oct 15, 2022
@cryptoAlgorithm cryptoAlgorithm added ui User interface-related issues and removed bug Something isn't working triage Waiting for this issue to be triaged labels Oct 17, 2022
@cryptoAlgorithm
Copy link
Member

This appears to be yet another issue related to SwiftyGif not being so swifty after all. I might have to implement a more performant implementation using CoreGraphics directly.

@cryptoAlgorithm cryptoAlgorithm moved this to Todo in Swiftcord Oct 18, 2022
@cryptoAlgorithm cryptoAlgorithm added this to the architecture overhaul milestone Oct 20, 2022
@cryptoAlgorithm cryptoAlgorithm moved this from Backlog (Bugfixes) to Backlog (Enhancements) in Swiftcord Oct 20, 2022
@cryptoAlgorithm cryptoAlgorithm moved this from Backlog (Enhancements) to Backlog (Bugfixes) in Swiftcord Oct 20, 2022
@cryptoAlgorithm cryptoAlgorithm moved this from Backlog (Enhancements) to Backlog (Bugfixes) in Swiftcord Oct 20, 2022
@ErrorErrorError
Copy link
Contributor

ErrorErrorError commented Apr 7, 2023

@cryptoAlgorithm you could consider using Nuke which does simplify a lot of the image loading if that's something you don't want to reimplement from scratch.

@cryptoAlgorithm
Copy link
Member

@ErrorErrorError That's interesting, it like a good alternative to replace both CachedAsyncImage and SwiftyGif 🤔. And it even has first-class SwiftUI support. I will consider refactoring with Nuke in a PR to evaluate its advantages soon.

@cryptoAlgorithm
Copy link
Member

@ErrorErrorError I dug deeper and it appears that we are back with the same issues as before. Nuke is a performant image loading solution, but out of the box it does not support rendering animated GIFs (or any other format not natively supported by the system). I'll have to integrate it with another library which actually renders GIFs, and the bottleneck we're facing resides in this rendering library.

It's a bit of a bummer, but I might still consider migrating to Nuke from CachedAsyncImage as it appears to have better caching and loading heuristics.

@cryptoAlgorithm
Copy link
Member

After throwing together some quick code to use Nuke instead of CachedAsyncImage to evaluate its suitability, I have come to the conclusion that migration isn't worth it as it actually leads to (very noticeably) worse scrolling performance, albeit with slightly better caching (and so lower network activity). I feel that scrolling performance impacts virtually all users, so saving a few kBs of network activity is not worth it for the significant scroll jank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui User interface-related issues
Projects
Status: Backlog (Bugfixes)
Development

No branches or pull requests

3 participants