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

[NEW] Improve latency and TPS with second-level prefetching: prefetch value data structures of incoming commands #1594

Open
xbasel opened this issue Jan 21, 2025 · 1 comment

Comments

@xbasel
Copy link
Member

xbasel commented Jan 21, 2025

The current code improves latency and TPS by prefetching incoming commands, including their parsed data. It also utilizes the incremental find API of hashtables to locate keys in the main hashtables, prefetching memory in a BFS style.

We can further enhance this mechanism by prefetching within the data structures stored in the values. For example, for hash/set-based commands, we can use the existing incremental API to load the required memory into the cache before executing the command. This approach can also be extended to other data structures, such as lists and more.

For example:
For hget myhash f1 f2 f3, once myhash is located and a pointer to the value (which is a hashtable is obtained), we can use the incremental API to lookup f1/f2/f3 in a BFS style.

The problem/use-case that the feature addresses

This feature aims to improve latency and transaction throughput for specific workloads.

Description of the feature

I propose adding a prefetch handler for each applicable command, with this data stored in

@xbasel xbasel changed the title [NEW] Improve latency by second-level prefetching, prefetch value data structures of incoming commands before executing them [NEW] Improve Latency with Second-Level Prefetching: Prefetch Value Data Structures of Incoming Commands Jan 21, 2025
@xbasel xbasel changed the title [NEW] Improve Latency with Second-Level Prefetching: Prefetch Value Data Structures of Incoming Commands [NEW] Improve latency and TPS with second-level prefetching: prefetch value data structures of incoming commands Jan 21, 2025
@xbasel
Copy link
Member Author

xbasel commented Jan 21, 2025

We also need to consider distributing second-level prefetching between command pre-processing and command execution. For instance, when executing a multi-key command, prefetching all parameters at once may not always be optimal. The solution should be designed to enable continuous prefetching throughout the command execution process.

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

No branches or pull requests

1 participant