Closed rueian closed 1 year ago
Hi @eko, @rwrz,
Following https://github.com/eko/gocache/issues/187, I made some breaking changes in this PR:
Get()
GetWithTTL()
string
rueidis.RedisResult
Set()
And some improvements:
SADD
EXPIRE
SMEMBERS
Invalidate()
I also re-run the BenchmarkRueidisSet:
BenchmarkRueidisSet
BEFORE:
goos: darwin goarch: arm64 pkg: github.com/eko/gocache/store/rueidis/v4 BenchmarkRueidisSet BenchmarkRueidisSet/1 BenchmarkRueidisSet/1-10 18704 61512 ns/op BenchmarkRueidisSet/2 BenchmarkRueidisSet/2-10 9661 124730 ns/op BenchmarkRueidisSet/4 BenchmarkRueidisSet/4-10 4776 247294 ns/op BenchmarkRueidisSet/8 BenchmarkRueidisSet/8-10 2469 491906 ns/op BenchmarkRueidisSet/16 BenchmarkRueidisSet/16-10 1213 982676 ns/op BenchmarkRueidisSet/32 BenchmarkRueidisSet/32-10 607 1964616 ns/op BenchmarkRueidisSet/64 BenchmarkRueidisSet/64-10 303 3930002 ns/op BenchmarkRueidisSet/128 BenchmarkRueidisSet/128-10 152 7860255 ns/op BenchmarkRueidisSet/256 BenchmarkRueidisSet/256-10 74 15707281 ns/op BenchmarkRueidisSet/512 BenchmarkRueidisSet/512-10 37 31525639 ns/op BenchmarkRueidisSet/1024 BenchmarkRueidisSet/1024-10 18 63099289 ns/op PASS
AFTER:
goos: darwin goarch: arm64 pkg: github.com/eko/gocache/store/rueidis/v4 BenchmarkRueidisSet BenchmarkRueidisSet/1 BenchmarkRueidisSet/1-10 27085 42312 ns/op BenchmarkRueidisSet/2 BenchmarkRueidisSet/2-10 14272 84054 ns/op BenchmarkRueidisSet/4 BenchmarkRueidisSet/4-10 7027 167840 ns/op BenchmarkRueidisSet/8 BenchmarkRueidisSet/8-10 3525 330211 ns/op BenchmarkRueidisSet/16 BenchmarkRueidisSet/16-10 1774 660522 ns/op BenchmarkRueidisSet/32 BenchmarkRueidisSet/32-10 891 1321188 ns/op BenchmarkRueidisSet/64 BenchmarkRueidisSet/64-10 445 2615865 ns/op BenchmarkRueidisSet/128 BenchmarkRueidisSet/128-10 224 5278540 ns/op BenchmarkRueidisSet/256 BenchmarkRueidisSet/256-10 100 10586973 ns/op BenchmarkRueidisSet/512 BenchmarkRueidisSet/512-10 54 21222888 ns/op BenchmarkRueidisSet/1024 BenchmarkRueidisSet/1024-10 27 42436995 ns/op PASS
Thank you so much @rueian!
Hi @eko, @rwrz,
Following https://github.com/eko/gocache/issues/187, I made some breaking changes in this PR:
Get()
andGetWithTTL()
return gostring
instead ofrueidis.RedisResult
to be more user-friendly.Set()
only accept gostring
value, sinceGet()
also returns gostring
.GetWithTTL()
retrive client-side TTL without additional network roundtrip.And some improvements:
SADD
andEXPIRE
while setting key tags to reduce network roundtrips.SMEMBERS
while doingInvalidate()
, since it will also be invalidated soon.I also re-run the
BenchmarkRueidisSet
:BEFORE:
AFTER: