-
Notifications
You must be signed in to change notification settings - Fork 33
Optimize cache-misses on sds free #202
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
Optimize cache-misses on sds free #202
Conversation
2d9e388 to
6b5165f
Compare
michalbiesek
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @jschmieg and @michalbiesek)
src/object.c, line 289 at r1 (raw file):
} }
nit: remove one newline - one is sufficient here
src/sds.c, line 192 at r1 (raw file):
static inline int sdsHdrSizeOptim(char* s) { switch((uintptr_t)s%8) { case 1:
please use spaces instead of tabs. Can we move this function upper see that inline functions are defined in the beginning?
449a6ba to
ef35930
Compare
michalbiesek
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @jschmieg and @michalbiesek)
src/sds.c, line 66 at r2 (raw file):
%8
Instead of "%8" can we use "&7" the result is the same but the second form is more efficient. The compiler with optimization will probably turn this in the same code but if you see e.g. siphash.c file there you have usage of the version with the bitwise operator and I prefer not to rely on the compiler itself as this is a pretty common pattern
Eliminates cache-miss on free of String. SdsHdrSize is retieved from calculating %8 operation on sds pointer. Added padding in 2 Sds Headers to have unique value of %8 operation.
michalbiesek
left a comment
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.
Reviewed 2 of 4 files at r1, 2 of 2 files at r2, 2 of 2 files at r4.
Reviewable status:complete! all files reviewed, all discussions resolved
[5.0.0-devel] Fix make test failing
This change is