amazon-ion / ion-go

A Go implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
174 stars 31 forks source link

Improve performance on validating structs' fields type for unmarshalling values with annotation #110

Closed R-maan closed 4 years ago

R-maan commented 4 years ago

As pointed out in this review comment:

At the moment we're allocating a new slice for [type]AcceptableKinds in every decode[Type]To method and we're doing a linear search over those kinds in this method. I think we can make a single object to hold maps of the acceptable kinds for each type so we can allocate them once and search them quickly.