ffjson
ffjson copied to clipboard
Performance worse in simple scenarios
I was looking into adding ffjson to (https://github.com/alecthomas/go_serialization_benchmarks (like #154 was suggesting) and found that ffjson made things a good deal worse in the benchmark.
https://github.com/chuyskywalker/jsontest
On my local machine, with struct_ffjson.go
removed:
BenchmarkJsonMarshal-8 500000 2475 ns/op 536 B/op 6 allocs/op
BenchmarkJsonUnmarshal-8 500000 3452 ns/op 447 B/op 8 allocs/op
With struct_ffjson.go
in place:
BenchmarkJsonMarshal-8 500000 3495 ns/op 949 B/op 13 allocs/op
BenchmarkJsonUnmarshal-8 300000 4350 ns/op 848 B/op 14 allocs/op
Maybe I did something wrong here?