-
Notifications
You must be signed in to change notification settings - Fork 656
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
Integrating fast_float to optionally replace strtod #1260
Conversation
I suppose I don't really understand the benefit of a submodule vs inlining. Since we aren't tightly controlling the versioning between the main repo and releases, it becomes much harder to know if there is a security issue impacting a specific release. At the very least we should be pinning a specific version of fast_float that we are pulling. |
We track fast_float commit id in the valkey repository with this change - see the copy pasted change from my commit below. For every valkey commit, we can look up exact version of fast_float at all times using this method. Pulling new fast_float version is as simple as git pull on the submodule. Submodule fast_float added at e800ca |
Does it get pulled automatically as part of the release into the release artifacts? |
There is a "git submodule update --init" command in Makefile to initialize it automatically. So yes, It will automatically checkout the same commit every time during build. |
So we are adding a new dependency to the release process, since you need to be able to fetch the code from github. I think we should consider figuring out how to pull the code in when we do a release so that folks don't need to do |
The other approach would be to just check-in the whole git repo as a folder under valkey, which should work. What is the issue with git dependency in github release workflows? I can put a post-checkout hook that always initializes modules on checkout, as long as checkout happens outside of the release process. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1260 +/- ##
============================================
+ Coverage 70.55% 70.76% +0.20%
============================================
Files 115 117 +2
Lines 63158 63305 +147
============================================
+ Hits 44561 44797 +236
+ Misses 18597 18508 -89
|
I am dropping the submodule idea for now as it requires a larger discussion about release process. I don't have access to @swaingotnochill's repository or PR. Therefore, I pulled his commit into this CR to maintain his author-ship on the code he wrote. I integrated it with Redis and fixed the Makefile. It should build now and will be ready to push. I will work on benchmarking this separately. I can also turn off fast_float by default if folks have concerns and test it on my branch. |
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.
Feel free to modify. I am on a vacation so it will be difficult for me to work until I am back. Cheers
@zuiderkwast or @madolson any pointers on how to solve almalinux issue with missing g++?
|
I'm skeptical to submodules too. Offline builds get complicated. Source releases get complicated. So far, we've used either vendored dependencies or system installed ones (like OpenSSL). I prefer that we vendor this one. We could copy only one or a few files, as we've done with crc64 and some other small libraries? |
…or replacing strtod Signed-off-by: Parth Patel <[email protected]>
* Simplified the interface to remove if branches. * Simplified Makefile to be more readable. * Integrating fast_float with the redis code base in resp_parser.c file. Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
… issues. Signed-off-by: Parth Patel <[email protected]>
…d packages. Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
…fy it explicitly in Makefile to fix 32-bit compilation issues. Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
…i386 compilation Signed-off-by: Parth Patel <[email protected]>
…compilations Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
…interface Makefile Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
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.
Looks really close now, I'm going to just apply some of these comments right away.
Signed-off-by: Madelyn Olson <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Parth Patel <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
Running ASAN, https://github.com/valkey-io/valkey/actions/runs/11966743688. |
Signed-off-by: Madelyn Olson <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
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.
LGTM, @eifrah-aws can you help followup with the CMake changes like we discussed offline?
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.
Thanks for pushing this through! Just one nit.
should we do a benchmark on different architectures for this change? |
@swaingotnochill That never harms! I think it only affects commands with floats, like INCRBYFLOAT and sorted sets, so I would only benchmark things like that. |
Errno is never set to zero by any C standard library function. This function mimics strtod. Signed-off-by: Viktor Söderqvist <[email protected]>
Fast_float is a C++ header-only library to parse doubles using SIMD instructions. The purpose is to speed up sorted sets and other commands that use doubles. A single-file copy of fast_float is included in this repo. This introduces an optional dependency on a C++ compiler.
The use of fast_float is enabled at compile time using the make variable
USE_FAST_FLOAT=yes
. It is disabled by default.Fixes #1069.