-
Notifications
You must be signed in to change notification settings - Fork 510
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
Experiment with string interning on BlockMeta #3931
Conversation
150532f
to
cf13180
Compare
c48ee2e
to
82789ca
Compare
82789ca
to
188cab5
Compare
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 know we are discussing moving from json to proto but this lib here claims to be more performant https://github.com/json-iterator/go
We already use it in some places
@@ -89,6 +90,28 @@ type CompactedBlockMeta struct { | |||
CompactedTime time.Time `json:"compactedTime"` | |||
} | |||
|
|||
func (b *CompactedBlockMeta) UnmarshalJSON(data []byte) error { |
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 experimented with the alias here as well, but the embedding throws it off. I think we keep the custom change without the alias here unless I missed something obvious.
We're not seeing the improvements we want to see here. The extra allocations are making us rethink our approach. |
What this PR does:
Here is a bit of experiment to see if we can reduce the size of memory that the poller consumes.
intern
package which will intern a stringUnmarshalJson
onBlockMeta
andCompactedBlockMeta
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]