Skip to content
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

Adapters: Update to use jsonutil unmarshal #4021

Merged
merged 9 commits into from
Oct 30, 2024

Conversation

bsardo
Copy link
Collaborator

@bsardo bsardo commented Oct 28, 2024

No description provided.

@bsardo bsardo marked this pull request as ready for review October 30, 2024 04:07
@linux019
Copy link
Contributor

Why not use https://github.com/bytedance/sonic ? It's a fastest json lib with JIT (de)serializer

@bsardo
Copy link
Collaborator Author

bsardo commented Oct 30, 2024

Why not use https://github.com/bytedance/sonic ? It's a fastest json lib with JIT (de)serializer

Hi @linux019. This question came up earlier this year. Here is the explanation pulled from the linked issue comment:

We recently switched from "encoding/json" to "json-iterator/go" after reviewing alternative options. We dismissed the "mailru/easyjson" library because its no longer maintained and has as pre-build step. Though, I think the community would support a pre-build steps for a significant performance gain.

While many projects claim to be compatible as a drop-in replacement for "encoding/json", in reality none are. We choose "json-iterator/go" because it was the closest and required the least amount of modification for a 2-3x performance gain. There were other libraries we evaluated which encode faster and use less allocations such as "goccy/go-json", but those failed in specific edge cases covered by Prebid Server tests.

As part of replacing the json library, we created new utility methods in "util/jsonutil" to centralize the library call. This will make it easier for you, or others, to try different libraries.

Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bsardo bsardo merged commit 5b11f59 into prebid:master Oct 30, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants