mirror of https://github.com/spf13/viper.git
fc6df51032
This patch significantly improves `v.find` performance by using ristretto cache. Ristretto was chosen because it is a very performant, thread-safe cache that does not suffer form congestion or long GC pauses. ``` % go test -bench=. . goos: darwin goarch: amd64 pkg: github.com/spf13/viper BenchmarkGetBool-8 5431267 211 ns/op BenchmarkFind/cache=false-8 289495 4060 ns/op BenchmarkFind/cache=true-8 6980976 171 ns/op BenchmarkGet-8 6332091 193 ns/op BenchmarkGetBoolFromMap-8 235071828 5.09 ns/op PASS ``` |
||
---|---|---|
.. | ||
benchmark.json |