General purpose memoization tool#43868
Conversation
|
Current state of the types in the Here is a TS Playground with minimal reproducible sample for the issue. Also here is a link to SO where the difficulty is discussed, but it is not 100% equivalent. In general, the If you know how to resolve the typings issue, please let me know 🙏 |
@kacper-mikolajczak Isn't it this code here that's throwing the lint error? |
|
@kacper-mikolajczak Please merge main to resolve or it must be coming from this PR. Yeah I think we can proceed with this PR even if there are the issues you have mentioned remaining, but we need to address them in a follow up |
|
Great @mountiny! PR is ready to be merged 👍 What would be the best steps to go with regarding follow-up fixes? Should I create issues ahead-of-time (not sure if we have correct label), or treat their description in this PR as the origin and wait with creating them after the merge? |
|
@mananjadhav thanks for thorough review! 🥇 |
|
I’ll test this in a while. |
|
Here are the results of monitoring the cache when following QA steps. Cache details{
"appVersion": "9.0.10-2",
"environment": "development",
"platform": "android",
"totalMemory": "1.92 GiB",
"usedMemory": "774.04 MiB",
"memoizeStats": [
{
"id": "NumberFormat",
"stats": {
"calls": 30,
"hits": 26,
"avgCacheRetrievalTime": 0.01402397899907994,
"avgFnTime": 6.5312082500895485,
"cacheSize": 4
}
},
{
"id": "getLocaleDigits",
"stats": {
"calls": 11,
"hits": 10,
"avgCacheRetrievalTime": 0.0018999999854713678,
"avgFnTime": 0.8545420002192259,
"cacheSize": 1
}
},
{
"id": "getEmojiUnicode",
"stats": {
"calls": 116,
"hits": 104,
"avgCacheRetrievalTime": 0.005968057494505178,
"avgFnTime": 0.0840590833298241,
"cacheSize": 12
}
},
{
"id": "getUnreadReportsForUnreadIndicator",
"stats": {
"calls": 14,
"hits": 9,
"avgCacheRetrievalTime": 0.5056088889293648,
"avgFnTime": 0.3653247999958694,
"cacheSize": 6
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 2,
"hits": 1,
"avgCacheRetrievalTime": 0.0117080002091825,
"avgFnTime": 2.003707999829203,
"cacheSize": 1
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 0,
"hits": 0,
"avgCacheRetrievalTime": 0,
"avgFnTime": 0,
"cacheSize": 0
}
},
{
"id": "freezeScreenWithLazyLoading",
"stats": {
"calls": 4,
"hits": 3,
"avgCacheRetrievalTime": 0.015042000294973453,
"avgFnTime": 144.09425000008196,
"cacheSize": 1
}
}
]
}RecordingScreen.Recording.2024-07-23.at.09.05.04.mp4The cache performance seems to be fine, but there are two issues:
CC @adhorodyski |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
I checked and the currency loader worked fine for me. I'll do one round of testing more and update the screenshots. |
mananjadhav
left a comment
There was a problem hiding this comment.
I added additional screenshots here except for Android. I don't have a physical device right now and having some system issues.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.12-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.12-0 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.13-0 🚀
|
Details
PR implements POC2 (continuation of #43538) of memoization tool for general purpose use. The main goal is to:
Minor to do:
Fixed Issues
$ #42200
PROPOSAL: https://expensify.slack.com/archives/C01GTK53T8Q/p1716371827915779
Tests
LHNFABSubmit ExpenseProfilescreenOffline tests
N/A
QA Steps
LHNFABSubmit ExpenseProfilescreenPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4