-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Use pointer for arg key in cache key #553
Conversation
…inyGo to work well
Codecov ReportBase: 78.50% // Head: 78.51% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## v3/dev #553 +/- ##
=======================================
Coverage 78.50% 78.51%
=======================================
Files 145 145
Lines 6955 6958 +3
=======================================
+ Hits 5460 5463 +3
Misses 1263 1263
Partials 232 232
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
LGTM, anyways we can change it any moment as this is internal. |
Cool, then need approval to merge |
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.
Lgtm
It does happen to work and enables TinyGo to work well
See tinygo-org/tinygo#3354 for context
I found that TinyGo does not handle map keys with embedded variable-length fields (basically just
string
I guess) well, converting to interface and using reflection, which causes allocations and general slowness.The arg key string coincidentally has a stable pointer for our purposes here...so we can use it.
This is an alternative to #552 but is very hacky. If it seems like too much, we can give up on the cache for now. But I do think the cache is important for performance so maybe we can live with it. I would be surprised if FTW were to pass in the future if a bug was caused by the pointer stability property not being valid anymore, so that safety measure is there, I guess.