4 ms·
How does this compare to something like https://github.com/valyala/fastjson https://github.com/valyala/fastjson ?
by throwaway77384 6y ago
How does this compare to something like https://github.com/valyala/fastjson https://github.com/valyala/fastjson ?
- peterohler 6y agoThe fastjson package is fast. Can't disagree but unfortunately it accepts invalid JSON and what you get from the parser is a Value that you can get values from using a Get() function and not a simple go type. To get a simple go type like []interface{} or map[string]interface{} you have to know what the paths are. You can't actually iterate over a map as far as I can tell. Basically the two packages are different in what they provide. OjG returns simple go types and instead of a simple Get() it provides a full JSONPath implementation. Different but both have their uses so depending on a user's needed one might be better than the other.