...
Parser | Read 40 characters | Write 40 characters | Read 100 characters | Write 100 characters | Read 1000 characters | Write 1000 characters | Issues |
---|---|---|---|---|---|---|---|
Jackson | 7.488 microseconds | 0.296 microseconds | 10.984 microseconds | 0.567 microseconds | 50.49 microseconds | 5.12 microseconds | |
GSON | 0.509 microseconds | 0.531 microseconds | 0.818 microseconds | 1.332 microseconds | 8.212 microseconds | 14.884 microseconds | GSON parses all numerical values to Doubles and as such it unable to dynamically allocate the object type that it is parsing |
Parser | Pros | Cons | |
---|---|---|---|
Jackson | Consistent conversion of numerics | Slower Read | |
GSON | Faster Reads | Converts numerics to Doubles | |
Resolution
It would make the most sense to use GSON as much as possible as it is the faster than Jackson. However the practicality of Jacksons parsing cannot be overlooked. Therefore it would make sense to use the Jackson parser in this scenario. We also don't want to have or create a Jackson mapper and GSON mapper object in the same file however as the memory cost is quite high.
...