Open jkomoros opened 7 years ago
https://github.com/pquerna/ffjson might be better because it's a drop-in replacement for MarshalJSON/UnmarshalJSON
Another approach is to just have a MarshalJSON / UnmarshalJSON that takes a PropertyReadSetter / PropertyReadSetConfigurator and the blob that should match and deserializes. And benchmark to see how much faster that is.
Did this for generating json (in branch reader-json
) and didn't have any appreciable performance difference. :-/
Another one to look into: https://github.com/valyala/fastjson
We go to great lengths to avoid reflection in many parts of the library... but then use MarshalJSON and UnmarshalJSON, which have significant performance overhead.
Should we use e.g. https://github.com/mailru/easyjson, which uses generated code?