bloblru: Upgrade to hashicorp/golang-lru/v2

The new genericized LRU cache no longer needs to have the IDs separately
allocated:

name   old time/op    new time/op    delta
Add-8     494ns ± 2%     388ns ± 2%  -21.46%  (p=0.000 n=10+9)

name   old alloc/op   new alloc/op   delta
Add-8      176B ± 0%      152B ± 0%  -13.64%  (p=0.000 n=10+10)

name   old allocs/op  new allocs/op  delta
Add-8      5.00 ± 0%      3.00 ± 0%  -40.00%  (p=0.000 n=10+10)
This commit is contained in:
greatroar
2022-11-27 09:58:19 +01:00
parent 05cebc1c4b
commit e5d597fd22
4 changed files with 38 additions and 16 deletions

2
go.mod
View File

@@ -9,7 +9,7 @@ require (
github.com/elithrar/simple-scrypt v1.3.0
github.com/go-ole/go-ole v1.2.6
github.com/google/go-cmp v0.5.9
github.com/hashicorp/golang-lru v0.5.4
github.com/hashicorp/golang-lru/v2 v2.0.1
github.com/juju/ratelimit v1.0.2
github.com/klauspost/compress v1.15.9
github.com/kurin/blazer v0.5.4-0.20211030221322-ba894c124ac6