noodlebox / KawaiiDiscord

Add huge sets of external emotes to Discord
MIT License
6 stars 2 forks source link

Debounce MutationObserver callbacks #6

Closed noodlebox closed 6 years ago

noodlebox commented 8 years ago

The UI can feel sluggish when large changes occur (like switching channels), or when there's a lot of emotes to replace. This should probably happen before fixing #5, which needs to additionally handle mutations to element data.

Ideally, the work should be put off until a requestAnimationFrame callback. It may also help to break work up into smaller chunks (<~3ms), though this should try avoid triggering a ton of ugly layout changes if possible.