Repository navigation
Optimize endian conversion functions - #3201
Merged
Merged
Conversation
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
enjoy-binbin
approved these changes
Feb 14, 2026
harrylin98
pushed a commit
to harrylin98/valkey_forked
that referenced
this pull request
Feb 19, 2026
Replace the implementation of byte-reverse functions. The new implementation compiles to a single bswap instruction. The old implementation didn't. The new implementation is small and all in the .h file. The .c file is deleted. On little-endian systems, this affects streams, module timers and cluster code and a few more things, where `htonu64()` is used for storing stream-id or timestamps in a rax in big-endian order. --------- Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
hpatro
pushed a commit
to hpatro/valkey
that referenced
this pull request
Mar 5, 2026
Replace the implementation of byte-reverse functions. The new implementation compiles to a single bswap instruction. The old implementation didn't. The new implementation is small and all in the .h file. The .c file is deleted. On little-endian systems, this affects streams, module timers and cluster code and a few more things, where `htonu64()` is used for storing stream-id or timestamps in a rax in big-endian order. --------- Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Harkrishn Patro <bunty.hari@gmail.com>
nesty92
pushed a commit
to nesty92/valkey
that referenced
this pull request
Mar 12, 2026
- Revert getClientType() from static inline in server.h back to regular function in networking.c, removing the cache locality optimization - Revert stream iterator to use start_key/end_key as encoded 128-bit big-endian values instead of streamID, using memcmp instead of streamCompareID for range checks - Remove streamID2string() and simplify createStreamIDString() to use sdscatfmt directly - Replace memcpy with individual byte assignments in ull2string() - Move slot_migration_job back to client state structs group in server.h https://claude.ai/code/session_01X12N98RpdCHX2dwW6RcXPs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the implementation of byte-reverse functions.
The new implementation compiles to a single bswap instruction. The old implementation didn't.
The new implementation is small and all in the .h file. The .c file is deleted.
On little-endian systems, this affects streams, module timers and cluster code and a few more things, where
htonu64()is used for storing stream-id or timestamps in a rax in big-endian order.