-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
GEORADIUSBYMEMBER command #1294
base: master
Are you sure you want to change the base?
Conversation
cd3ad76
to
0ca529a
Compare
Hi @benbarten. And geohash area filter is returning elements that are outside the specified radius as well.
Thanks. |
Hey @c-harish, Thank you for pointing out those issues. I should have tested this more thoroughly beforehand. The implementation has a couple of different issues which I resolved in my last commit:
Please, feel free to test again. How should we split up the remaining tasks? |
c890c61
to
13404a6
Compare
@c-harish I would continue working on the STORE and STOREDIST options. |
13404a6
to
2e24427
Compare
Tremendous job, @benbarten. 🚀 |
@c-harish I looked into the implementation of STORE and STOREDIST this morning and I will need a few more days to finalize it.
My idea is to decompose the command into a |
Hi @benbarten, @AshwinKul28, Can you please confirm? |
As far as I understand, the shard is determined by the key. The Maybe my understanding is wrong here, but I tested locally to store data for a different key directly using the |
Added the unit tests this morning. Will do benchmarking tomorrow and then we can decide whether to merge like this or add the |
BenchmarksBase command Running tool: /opt/homebrew/bin/go test -benchmem -run=^$ -bench ^BenchmarkGEORADIUSBYMEMBER$ github.com/dicedb/dice/internal/eval
goos: darwin
goarch: arm64
pkg: github.com/dicedb/dice/internal/eval
cpu: Apple M2
=== RUN BenchmarkGEORADIUSBYMEMBER
BenchmarkGEORADIUSBYMEMBER
=== RUN BenchmarkGEORADIUSBYMEMBER/Small
BenchmarkGEORADIUSBYMEMBER/Small
BenchmarkGEORADIUSBYMEMBER/Small-8 462044 2393 ns/op 1048 B/op 39 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER/Medium
BenchmarkGEORADIUSBYMEMBER/Medium
BenchmarkGEORADIUSBYMEMBER/Medium-8 106651 27096 ns/op 4920 B/op 100 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER/Large
BenchmarkGEORADIUSBYMEMBER/Large
BenchmarkGEORADIUSBYMEMBER/Large-8 26185 214080 ns/op 27480 B/op 352 allocs/op
PASS
ok github.com/dicedb/dice/internal/eval 10.258s Different Radii Running tool: /opt/homebrew/bin/go test -benchmem -run=^$ -bench ^BenchmarkGEORADIUSBYMEMBER_DifferentRadii$ github.com/dicedb/dice/internal/eval
goos: darwin
goarch: arm64
pkg: github.com/dicedb/dice/internal/eval
cpu: Apple M2
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentRadii
BenchmarkGEORADIUSBYMEMBER_DifferentRadii
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentRadii/SmallRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/SmallRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/SmallRadius-8 38484 30515 ns/op 1288 B/op 47 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentRadii/MediumRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/MediumRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/MediumRadius-8 41575 28804 ns/op 13992 B/op 197 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentRadii/LargeRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/LargeRadius
BenchmarkGEORADIUSBYMEMBER_DifferentRadii/LargeRadius-8 15754 76014 ns/op 95817 B/op 1470 allocs/op
PASS
ok github.com/dicedb/dice/internal/eval 5.211s Different options Running tool: /opt/homebrew/bin/go test -benchmem -run=^$ -bench ^BenchmarkGEORADIUSBYMEMBER_DifferentOptions$ github.com/dicedb/dice/internal/eval
goos: darwin
goarch: arm64
pkg: github.com/dicedb/dice/internal/eval
cpu: Apple M2
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions
BenchmarkGEORADIUSBYMEMBER_DifferentOptions
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions/NoOptions
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/NoOptions
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/NoOptions-8 259896 3899 ns/op 3848 B/op 76 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithCoord
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithCoord
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithCoord-8 303004 3948 ns/op 4080 B/op 80 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithDist
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithDist
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithDist-8 297511 4064 ns/op 4056 B/op 79 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithHash
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithHash
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/WithHash-8 299065 3982 ns/op 4064 B/op 80 allocs/op
=== RUN BenchmarkGEORADIUSBYMEMBER_DifferentOptions/AllOptions
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/AllOptions
BenchmarkGEORADIUSBYMEMBER_DifferentOptions/AllOptions-8 294674 4034 ns/op 4152 B/op 82 allocs/op
PASS
ok github.com/dicedb/dice/internal/eval 6.275s |
Hi, @apoorvyadav1111. |
e68a096
to
9a9753f
Compare
…T [ANY] options in GEORADIUSBYMEMBER cmd
… and finalize GEORADIUSBYMEMBER command
…arameters are set
…s in processing neighbors and calculating hashes on step reduction
7a36319
to
275bcc6
Compare
Hey @apoorvyadav1111, any update on the review? I'm keeping it up-to-date with the latest changes, but let us know if we should request another reviewer :) We could unblock @c-harish and also add the STORE/STOREDIST options. |
Implementation of the GEORADIUSBYMEMBER command
github.com/mmcloughlin/geohash
with a redis-like implementation of geohash to make results comparableResolves #1252.