Pungyeon/required

Performance Optimisation

Closed this issue · 0 comments

The current performance is rather terrible, compared to the std library Unmarshal function. This doesn't deteriorate from the functionality of the package, but is completely avoidable. Therefore, getting as close to or improving on the performance of the std library Unmarshal function would be ideal.

Current metrics as of opening this issue:

goos: darwin
goarch: amd64
pkg: github.com/Pungyeon/json-validation/pkg/json
BenchmarkStdUnmarshal-4           139876              7848 ns/op
BenchmarkPkgUnmarshal-4            77419             14825 ns/op
PASS
ok      github.com/Pungyeon/json-validation/pkg/json    2.778s

So, about 2 times slower.