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

Emote cache for faster chat rendering #1244

Open
2 tasks done
hianick opened this issue Nov 7, 2024 · 5 comments
Open
2 tasks done

Emote cache for faster chat rendering #1244

hianick opened this issue Nov 7, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@hianick
Copy link

hianick commented Nov 7, 2024

Checklist

Write your feature request here

Currently you have to spend quite a bit of the chat render process looking up the emotes. There are a lot of universal emotes and editing for a single channel will use the same emotes most of the time and a local cache of emotes would be useful.

@hianick hianick added the enhancement New feature or request label Nov 7, 2024
@ScrubN
Copy link
Collaborator

ScrubN commented Nov 7, 2024

Emotes are already cached locally on the disk.

The reason it takes a while to fetch emotes is because we decode each image file sequentially. We do it this way because its simpler to handle. We also don't retain the decoded emotes in memory between renders because of both simplicity and for the rare case that emote definitions change while the app is open.

@ScrubN
Copy link
Collaborator

ScrubN commented Nov 7, 2024

I would be willing to look into refactoring the image fetching service to parallelize decoding cached images, but I will not be retaining emotes in memory between runs because that opens up a whole host of issues.

@superbonaci
Copy link
Contributor

The emotes as far as I know never change, so could not be better to have an assets folder in the project or a zip file where all the known emotes are there? Only fetch the new emotes until the project is updated, or just let the assets folder be updatable separately.

this can fix also #1241

@ScrubN
Copy link
Collaborator

ScrubN commented Nov 8, 2024

  1. Twitch global emotes are the fastest to fetch. The issue lies in Twitch channel emotes (on big channels like xqc) and 3rd party emote providers (especially 7tv with up to 1000 slots).
  2. I don't want to bloat the executable size by another few megabytes just to save a few seconds of download time.
  3. Implementing that would require a substantial amount of time and effort.
  4. Embedding Twitch global emotes wouldn't save any time in the scenario that @hianick was describing. It would only save time once by unpacking the global emotes from the executable instead of a dozen HTTP requests.
  5. This sounds like a huge legal issue as Twitch owns the exclusive rights to all of the emote images, which would allow them to DMCA this repo. They cannot DMCA the repo as it stands because Oracle vs. Google proved APIs are not copyrightable.

@glubsy
Copy link

glubsy commented Nov 9, 2024

The emotes as far as I know never change

They actually do change sometimes, albeit rarely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants