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
{{ message }}
Repository navigation
[HOLD for payment 2024-05-29] LOW: [$250] [Performance] Only import the preferred locale and load the other language dynamically if needed #41893
Currently, both translations for emoji in English (EN) and Spanish (ES) are imported during app initialization. Additionally, we create large objects of EmojiTrie for both languages. The idea is to import and build EmojiTrie only for the currently selected language.
Solution:
During app initialization, we check the preferred language and import only that translation file.
We create an EmojiTrie only for that selected language.
If the user changes the language, we will dynamically import the new translation file and create a new Trie object at that time.
In most cases, users only use one language, so by implementing this change, we can significantly reduce memory consumption and the time needed for creating large EmojiTrie objects.
Some numbers measured on web:
Before dynamic imports:
EmojiTrie Create time -> 66ms
we import and create EmojiTrie for all languages (for now we have en and es)
After dynamic imports:
EmojiTrie Create time -> 17ms
we import and create EmojiTrie only for one selected language
Another gain is that we don't keep expensive unused EmojiTrie in the memory
Note
On mobiles this adds up to ~300-400ms for the whole tree so each first chat visit is delayed by at least this much, definitely worth cutting it down
changed the title [-][Performance] Only import the preferred locale and load the other language dynamically if needed[/-][+][$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/+]on May 9, 2024
changed the title [-]LOW: [$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/-][+][HOLD for payment 2024-05-29] LOW: [$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/+]on May 29, 2024
Activity
melvin-bot commentedon May 9, 2024
Triggered auto assignment to @stephanieelliott (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.rinej commentedon May 9, 2024
Here is Tomek from callstack, I'd like to work on that
melvin-bot commentedon May 9, 2024
Job added to Upwork: https://www.upwork.com/jobs/~015852e4cf6c6066f2
[-][Performance] Only import the preferred locale and load the other language dynamically if needed[/-][+][$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/+]20 remaining items
stephanieelliott commentedon May 17, 2024
#41097 deployed to staging on May 15 🎉
stephanieelliott commentedon May 21, 2024
PR is still on staging, I am going to move this to
Weeklyin the meantimestephanieelliott commentedon May 29, 2024
This was deployed to prod on May 22, will be ready for payment on May 29
[-]LOW: [$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/-][+][HOLD for payment 2024-05-29] LOW: [$250] [Performance] Only import the preferred locale and load the other language dynamically if needed[/+]mountiny commentedon May 29, 2024
$250 to @shubham1206agra i dont think there is need for regression test here as its performance improvement
melvin-bot commentedon May 29, 2024
Payment Summary
Upwork Job
BugZero Checklist (@stephanieelliott)
stephanieelliott commentedon May 30, 2024
Hey @shubham1206agra I extended the offer to you in Upwork, can you accept it when you get a chance? https://www.upwork.com/nx/wm/offer/102533807
shubham1206agra commentedon May 31, 2024
@stephanieelliott Accepted
stephanieelliott commentedon Jun 1, 2024
All paid, thanks @shubham1206agra!