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

cassandra optimize murmur hashing #1406

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

rukai
Copy link
Member

@rukai rukai commented Dec 22, 2023

This PR improves performance of get_replica_node_in_dc by having calculate_routing_key directly convert the query values into a murmur hash instead of returning an intermediate value allocated into a Vec<u8>.

I very heavily referenced the scylla driver here as it is much more performant than the cdrs-tokio driver that the previous implementation was based off.

Unfortunately this PR brings a bunch of low level murmur hashing code into shotover, it would be nice if scylla driver exposed it but it feels like too much of a low level implementation detail to ask them to expose it. I think its still worth the performance win though.

I have verified that the changes to calculate_routing_key have reduced the total time spent in that function + dropping the return value.

@rukai rukai force-pushed the optimize_cassandra_routing_runtime branch 3 times, most recently from e0ff300 to 9cdd3d5 Compare December 22, 2023 05:20
@rukai rukai changed the title Optimize cassandra routing runtime cassandra optimize murmur hashing Jan 9, 2024
@rukai rukai force-pushed the optimize_cassandra_routing_runtime branch from 16df06d to 7e580f8 Compare January 9, 2024 02:33
@rukai rukai marked this pull request as ready for review January 9, 2024 02:44
@rukai rukai requested a review from conorbros January 9, 2024 02:58
@rukai rukai enabled auto-merge (squash) January 15, 2024 09:50
@rukai rukai merged commit 487f1f2 into shotover:main Jan 15, 2024
40 checks passed
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.

3 participants