-
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
Memoize: Debugging stats investigations #48319
Comments
After trying to follow Jason's flow and exploring different parts of the app, I've noticed:
Cache dump[
{
"id": "NumberFormatUtils",
"stats": {
"calls": 1813,
"hits": 1803,
"avgCacheRetrievalTime": 0.0023205953239618595,
"avgFnTime": 0.06000000089406967,
"cacheSize": 10
}
},
{
"id": "getLocaleDigits",
"stats": {
"calls": 183,
"hits": 182,
"avgCacheRetrievalTime": 0.004395604297354978,
"avgFnTime": 0.29999999701976776,
"cacheSize": 1
}
},
{
"id": "getEmojiUnicode",
"stats": {
"calls": 704,
"hits": 685,
"avgCacheRetrievalTime": 0.0017099554950169378,
"avgFnTime": 0.01578947431162784,
"cacheSize": 19
}
},
{
"id": "getUnreadReportsForUnreadIndicator",
"stats": {
"calls": 36,
"hits": 24,
"avgCacheRetrievalTime": 2.592046599053531,
"avgFnTime": 0.6083333355685075,
"cacheSize": 12
}
}
]
|
After investigating, the first call is registered properly. What is happening is that monitoring was enabled after initial function call was made, so the function call timing could not be registered and all subsequent calls were intercepted by the cache, so we ended up with zero value for fnTime. |
Action points from the table status update:
|
This issue has not been updated in over 15 days. @mountiny, @kacper-mikolajczak eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
@kacper-mikolajczak is this all done? can we close? |
@mountiny Affirmative! 🫡 |
Problem
The cache debugging stats provided via Jason's AppInfo file, show a couple of issues related to memoization:
monitoringName
property to inlined functions passed to memoizeavgFnTime
equal to zeroavgFnTime
should be equal to at least first function call timeavgFnTime
getEmojiUnicode
cache retrieval tends to be slower than actual function callgetEmojiUnicode
getLocaleDigits
seems to not be used at allgetUnreadReportsForUnreadIndicator
retrieval/execution times are way above expected (8ms/22ms)freezeScreenWithLazyLoading
creates many unnamed empty cache entriesmonitoringName
getItemHeightMemoized
lacks idmonitoringName
cacheRetrievalTime
measures the time for the cache itself but not for the entire memoize overheadmemoizeFnTime
as a new mark or changecacheRetrievalTime
to be measured from function startThe text was updated successfully, but these errors were encountered: