Do not copy all emojis in recentEmoji getter #340
No reviewers
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
Translation/Locale
WIP
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma-fe#340
Loading…
Reference in a new issue
No description provided.
Delete branch "sn0w/akkoma-fe:feature/optimize-recent-emojis"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the recentEmojis getter performs a concat of
rootState.instance.emoji
androotState.instance.customEmoji
.On instances with tons of emojis, this full copy can take forever.
In the case of cofe.rocks, emoji-reacting to a post will cause the browser to spend 7 seconds in
Array.prototype.concat
followed by a then relatively quickfind
call (~ 1-2 secs).This PR changes the code to avoid the copy and instead performs two separate searches.
Profiles of reacting to a post before and after the patch are attached (both with JIT disabled, but enabling JIT only makes the concat about 1-2 secs faster so it doesn't change much).
If the resulting object must be copied in a final step to avoid state issues let me know, I'm not deep enough into Vue to judge that.
yep this seems find, i can't find any obvious state issues so good by me - thanks!