You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👋 I learned about this project recently - it's very useful, thanks for publishing it!
emoji-toolkit is used in the emoji plugin for Draft.js. That plugin calls to emoji-toolkit's toShort repeatedly, on each emoji in emojibase-data/en/compact.json [shortnameToUnicode.ts link].
@marvinhagemeister and I took a look at it and found that replaceAll was calling ns.escapeRegExp repeatedly on the same regular expression cached by unicodeCharRegex. Changing toShort to not need that call reduced that processing time to <200ms.
I took the liberty of sending #57 preemptively - hope that's ok with you! 🙂
Since GitHub doesn't support uploading .json files directly, here's a .zip with before & after profiles: Performance Profiles.zip
The text was updated successfully, but these errors were encountered:
👋 I learned about this project recently - it's very useful, thanks for publishing it!
emoji-toolkit
is used in the emoji plugin for Draft.js. That plugin calls toemoji-toolkit
'stoShort
repeatedly, on each emoji inemojibase-data/en/compact.json
[shortnameToUnicode.ts
link].Doing so results in ~2 seconds processing time (!) (Mac Studio M1 Max), largely spent in
escapeRegexp
. You can see a full breakdown of the investigation here: https://github.com/JoshuaKGoldberg/repros/tree/draft-js-emoji-plugin-emoji-toolkit-performance#description-of-issue]
@marvinhagemeister and I took a look at it and found that
replaceAll
was callingns.escapeRegExp
repeatedly on the same regular expression cached byunicodeCharRegex
. ChangingtoShort
to not need that call reduced that processing time to <200ms.I took the liberty of sending #57 preemptively - hope that's ok with you! 🙂
Since GitHub doesn't support uploading
.json
files directly, here's a.zip
with before & after profiles: Performance Profiles.zipThe text was updated successfully, but these errors were encountered: