Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Rueidis store implementation #185

Merged
merged 1 commit into from
Dec 3, 2022
Merged

Conversation

rwrz
Copy link
Contributor

@rwrz rwrz commented Dec 3, 2022

Hey @eko , thanks for doing that and sorry for taking so long to include the tests.
I'm adding a new test for NotFound, just to ensure it is working as intended. Also, fixing the idea of the clientExpiration option I've done in the previous proposal. The idea here is to keep the expiration using TTL (server-side), but give an option to the user to use a different expiration time for the server-assisted client cache (more info on the link below).

Commit notes:

Adding ClientSideCacheExpiration option for rueidis, tweaking tests and benchmarks.

Benchmark Results:

goos: linux
goarch: amd64
pkg: github.com/eko/gocache/v4/store/rueidis
cpu: AMD Ryzen 5 1600 Six-Core Processor            
BenchmarkRueidisSet
BenchmarkRueidisSet/1
BenchmarkRueidisSet/1-12  	    6164	    243191 ns/op
BenchmarkRueidisSet/2
BenchmarkRueidisSet/2-12  	    3741	    463155 ns/op
BenchmarkRueidisSet/4
BenchmarkRueidisSet/4-12  	    1765	    719615 ns/op
BenchmarkRueidisSet/8
BenchmarkRueidisSet/8-12  	     897	   1371644 ns/op
BenchmarkRueidisSet/16
BenchmarkRueidisSet/16-12 	     397	   4154892 ns/op
BenchmarkRueidisSet/32
BenchmarkRueidisSet/32-12 	     224	   6195236 ns/op
BenchmarkRueidisSet/64
BenchmarkRueidisSet/64-12 	     100	  13440387 ns/op
BenchmarkRueidisSet/128
BenchmarkRueidisSet/128-12         	      38	  26693594 ns/op
BenchmarkRueidisSet/256
BenchmarkRueidisSet/256-12         	      16	  64581190 ns/op
BenchmarkRueidisSet/512
BenchmarkRueidisSet/512-12         	      10	 113861449 ns/op
BenchmarkRueidisSet/1024
BenchmarkRueidisSet/1024-12        	       5	 208020637 ns/op
BenchmarkRueidisGet
BenchmarkRueidisGet/1
BenchmarkRueidisGet/1-12           	 2415909	       620.8 ns/op
BenchmarkRueidisGet/2
BenchmarkRueidisGet/2-12           	 1023564	      1205 ns/op
BenchmarkRueidisGet/4
BenchmarkRueidisGet/4-12           	  499236	      2372 ns/op
BenchmarkRueidisGet/8
BenchmarkRueidisGet/8-12           	  270166	      4725 ns/op
BenchmarkRueidisGet/16
BenchmarkRueidisGet/16-12          	  112500	      9645 ns/op
BenchmarkRueidisGet/32
BenchmarkRueidisGet/32-12          	   56277	     18923 ns/op
BenchmarkRueidisGet/64
BenchmarkRueidisGet/64-12          	   30972	     42437 ns/op
BenchmarkRueidisGet/128
BenchmarkRueidisGet/128-12         	   16580	     77926 ns/op
BenchmarkRueidisGet/256
BenchmarkRueidisGet/256-12         	    6326	    168652 ns/op
BenchmarkRueidisGet/512
BenchmarkRueidisGet/512-12         	    3812	    319607 ns/op
BenchmarkRueidisGet/1024
BenchmarkRueidisGet/1024-12        	    2150	    624327 ns/op
PASS

@rwrz rwrz mentioned this pull request Dec 3, 2022
Copy link
Owner

@eko eko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you for your quick answer @rwrz!

@eko eko merged commit 373e087 into eko:RueidisStore Dec 3, 2022
@rwrz rwrz deleted the RueidisStoreV4 branch December 3, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants