-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Hash prefetching #2180
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
base: unstable
Are you sure you want to change the base?
Hash prefetching #2180
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2632,6 +2632,12 @@ int main(int argc, char **argv) { | |
| free(cmd); | ||
| } | ||
|
|
||
| if (test_is_selected("hget")) { | ||
| len = valkeyFormatCommand(&cmd, "HGET myhash%s element:__rand_int__", tag); | ||
| benchmark("HGET", cmd, len); | ||
| free(cmd); | ||
| } | ||
|
Comment on lines
+2635
to
+2639
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add integration coverage for the new default-suite HGET benchmark path. This changes default end-to-end benchmark behavior, but the existing integration suite snapshot shown for Suggested test updatediff --git a/tests/integration/valkey-benchmark.tcl b/tests/integration/valkey-benchmark.tcl
@@
assert_match {*calls=100,*} [cmdstat hset]
+ assert_match {*calls=100,*} [cmdstat hget]
assert_match {*calls=100,*} [cmdstat spop]As per coding guidelines, “End-to-end behavior changes should be covered by integration tests.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| if (test_is_selected("spop")) { | ||
| len = valkeyFormatCommand(&cmd, "SPOP myset%s", tag); | ||
| benchmark("SPOP", cmd, len); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key-to-command context is lost during value-prefetch dispatch.
KeyPrefetchInfobindsinfo->clientby key index (batch->clients[i]), but keys are enqueued per command while clients are enqueued per client. Once a client contributes multiple keys/queued commands, this mapping diverges; Line 147 then dereferencesinfo->client->parsed_cmdfrom the wrong context (or NULL) and may invoke an unrelated callback path.Please store per-key prefetch context at enqueue time (e.g., command/prefetch proc plus the argv context needed by the callback) and use that in
prefetchValueinstead of deriving frombatch->clients[i].Also applies to: 147-149, 259-293
🤖 Prompt for AI Agents