mapstructure
mapstructure copied to clipboard
Precompute decode hooks for performance reason
When using this library with ComposeDecodeHook we noticed some performance degration. After further investigation, it seems that a lot of time is spent inside typedDecodeHook on reflect func.
I think it would be possible to precompute the typedDecodeHook for all hooks given to ComposeDecodeHook. I applied the same patch to OrComposeDecodeHookFunc event though we don't use it.
Some of the comments got updated due to gofmt change in behaviour.
I can revert this part if it's a problem (or open a different PR just for it)
@mitchellh We've noticed the same performance issues as @Succo . Are there any plans to merge this?