fix(internal/json): add arrow_json_stdlib build tag #199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Grafana and Grafana plugins both use arrow-go, but do not use arrow's
internal/json
. A decent amount of used heap is initialized by https://github.com/goccy/go-json, so it would be useful to be able to prevent the initialization.The example below shows that 60% of this heap profile in a Grafana plugin is used by
go-json
's encoder & decoder packages.I have submitted a PR to go-json to switch to lazy initialization (additional details in the PR), but I am having a hard time getting a response from the maintainer, so am attempting a different approach to the problem with this PR.
What changes are included in this PR?
Adds
arrow_json_stdlib
build tag so that it's possible to switch toencoding/json
and avoid the overhead of https://github.com/goccy/go-json.Are these changes tested?
I tested this locally, but I can add coverage if this seems like an acceptable approach.
Are there any user-facing changes?