-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General purpose memoization tool #43868
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
LHN
FAB
Submit Expense
Profile
screenOffline tests
N/A
QA Steps
LHN
FAB
Submit Expense
Profile
screenPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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