-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Redis 8.0 M01 #13538
Merged
Merged
Redis 8.0 M01 #13538
Conversation
This file contains 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
## Proposed improvement This PR introduces the static inlined function `clientTypeIsSlave` which is doing only 1 condition check vs 3 checks of `getClientType`, and also uses the `unlikely` to tell the compiler that the most common outcome is for the client not to be a slave. Preliminary data show 3% improvement on the achievable ops/sec on the specific LRANGE benchmark. After running the entire suite we see up to 5% improvement in 2 tests. redis#13516 (comment) ## Context This optimization efforts comes from analyzing the profile info from the [memtier_benchmark-1key-list-1K-elements-lrange-all-elements](https://github.com/redis/redis-benchmarks-specification/blob/main/redis_benchmarks_specification/test-suites/memtier_benchmark-1key-list-1K-elements-lrange-all-elements.yml) benchmark. By going over it, we can see that `getClientType` consumes 2% of the cpu time, strictly to check if the client is a slave ( https://github.com/redis/redis/blob/unstable/src/networking.c#L397 , and https://github.com/redis/redis/blob/unstable/src/networking.c#L1254 ) Function | CPU Time: Total | CPU Time: Self | Module | Function (Full) -- | -- | -- | -- | -- _addReplyToBufferOrList->getClientType | 1.20% | 0.728s | redis-server | getClientType clientHasPendingReplies->getClientType | 0.80% | 0.482s | redis-server | getClientType --------- Co-authored-by: debing.sun <[email protected]>
redis#13495 introduced a change to reply -LOADING while flushing existing db on a replica. Some of our tests are sensitive to this change and do no expect -LOADING reply. Fixing a couple of tests that fail time to time.
A new BUILD_WITH_MODULES flag was added to the Makefile to control building the module directory. The new module directory includes a general Makefile that iterates over each module, fetch a specific version, and build it. Co-authored-by: YaacovHazan <[email protected]>
…tTypeEqual (redis#13529) This is a very easy optimization, that avoids duplicate computation of the object length for LREM, LPOS, LINSERT na LINDEX. We can see that sdslen takes 7.7% of the total CPU cycles of the benchmarks. Function Stack | CPU Time: Total | CPU Time: Self | Module | Function (Full) | Source File | Start Address -- | -- | -- | -- | -- | -- | -- listTypeEqual | 15.50% | 2.346s | redis-server | listTypeEqual | t_list.c | 0x845dd sdslen | 7.70% | 2.300s | redis-server | sdslen | sds.h | 0x845e4 Preliminary data showcases 4% improvement in the achievable ops/sec of LPOS in string elements, and 2% in int elements.
Found by @oranagra Currently, when the size of dict becomes 1, we do not check whether `delta` is positive or negative. As a result, `non_empty_dicts` is still incremented when the size of dict changes from 2 to 1. We should only increment `non_empty_dicts` when `delta` is positive, as this indicates the first time an element is inserted into the dict. --------- Co-authored-by: oranagra <[email protected]>
c0bee73
to
3fe802d
Compare
3fe802d
to
168d352
Compare
adamiBs
approved these changes
Sep 11, 2024
168d352
to
4955375
Compare
oranagra
approved these changes
Sep 12, 2024
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.
New Features in binary distributions
Potentially breaking changes
GETRANGE
returns an empty bulk when the negative end index is out of rangeSCAN
command when matching data typeBug fixes
RM_RdbLoad
to enable AOF after RDB loading is completedACL CAT
- return module commandscache_memory
offunctionsLibCtx
XTRIM
commandXINFO
when tombstone is after thelast_id
of the consume groupHDEL
of last field - update the global hash field expiration data structureCLUSTER SHARDS
command returns empty arrayModules API
RM_DefragAllocRaw
,RM_DefragFreeRaw
, andRM_RegisterDefragCallbacks
- defrag API to allocate and free raw memoryPerformance and resource utilization improvements
lpFind
STRING
datatype write commandsSMEMBERS
commandGEO*
commands replyHELLO
commandSCAN
command when matching data typeLREM
,LPOS
,LINSERT
, andLINDEX
commandsLRANGE
and other commands that perform several writes to client buffers per callused_memory
contention when updating from multiple threadsOther general improvements
-LOADING
on replica while flushing the dbCLI tools
dbnum
showed after the client reconnectedNotes