jsumners / alfred-emoji

Alfred workflow for searching and copying emoji
741 stars 32 forks source link

Update to use emojilib v3 #66

Closed jsumners closed 2 years ago

devnoname120 commented 2 years ago

Emoji search is significantly slower since this PR was merged.

Hypothesized culprits:

  1. Iterating on the objects of orderedEmoji is slower than on the primitive type strings of emojiNames.
  2. The new lib has an order of magnitude more emojis. Search is O(n) where n is the number of emojis. It's possible that n got considerably bigger.

If 1. is true, then precomputing a lookup during build would solve it. If 2. is true, we could use some kind of hash structure to precompute first 2-3 search letters, and then narrow down the remaining matches using previous method. This should mostly the solve the speed issues.

devnoname120 commented 2 years ago

Here is a fork that uses v2 if anyone has the same issue in the future: https://github.com/devnoname120/alfred-emoji/releases/tag/v1.11.0

jsumners commented 2 years ago

Please work with us instead of immediately starting forks. There has not been a new version published that utilizes the code in this PR as yet. There is plenty of time to work out issues before such happens.

devnoname120 commented 2 years ago

I don't plan to maintain the fork. It's just a quick and dirty solution (mostly for personal use) because I don't plan to invest time fixing the root issue in the short term.

devnoname120 commented 2 years ago

@jsumners I can confirm that the performance issues I was experiencing are resolved now.