-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat(java): decoder add cache #1684
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: LiangliangSui <[email protected]>
Signed-off-by: LiangliangSui <[email protected]>
typeName, k -> TYPE_NAME_ENCODER.encode(typeName, typeNameEncodings)); | ||
} | ||
|
||
public static String decodeFieldName(long hashCode, byte[] bytes, MetaString.Encoding encoding) { |
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.
Hashcode is an internal optimization, maybe we shouldn't make it pubic as an API for meta string encoder
Hi @LiangliangSui , meta string encoding is not in critical path, we don't need to cache it. And we've alreadly have cache in ClassResolver |
The meta string encoding cache is already implemented in |
Why is meta string encoding not in the critical path? I see that encoding is cached in Encoders, maybe decoding needs similar optimization? |
It's encoded only once and cached in ClassResolver |
Is there a way to add cache for decode and didn't introduce API like hashcode stuff? |
I also thought about what you said, we can only establish an association with String through |
The hashcode should not be added to MetaString API, it's really an internal implementation of class resolution |
Perhaps we can use |
What does this PR do?
org.apache.fury.meta.Encoders
adds cache to decoder and useshashCode
as key.Related issues
Does this PR introduce any user-facing change?
Benchmark