forked from redis/redis
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor optimization in kvstoreDictAddRaw when dict exists (redis#13054)
Usually, the probability that a dict exists is much greater than the probability that it does not exist. In kvstoreDictAddRaw, we will call kvstoreGetDict multiple times. Based on this assumption, we change createDictIfNeeded to something like get or create function: ``` before: dict exist: 2 kvstoreGetDict dict non-exist: 2 kvstoreGetDict after: dict exist: 1 kvstoreGetDict dict non-exist: 3 kvstoreGetDict ``` A possible 3% performance improvement was observed: In addition, some typos/comments i saw have been cleaned up.
- Loading branch information
1 parent
063de67
commit c854873
Showing
2 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
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
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