• Miek Gieben's avatar
    plugin/pkg/cache: smarter locking (#1164) · 5aa0d55e
    Miek Gieben authored
    Make the locking slightly smarter in Evict and add benchmark function.
    
    Seems a bit faster (there was some variance while performing these
    benchmarks)
    
    Master:
    BenchmarkCache-2   	 1000000	      2317 ns/op	       0 B/op	       0 allocs/op
    BenchmarkCache-2   	 1000000	      2032 ns/op	       0 B/op	       0 allocs/op
    
    This branch:
    BenchmarkCache-2   	 1000000	      1806 ns/op	       0 B/op	       0 allocs/op
    BenchmarkCache-2   	 1000000	      1809 ns/op	       0 B/op	       0 allocs/op
    5aa0d55e
cache.go 2.57 KB