-
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 with Valkey to replace strtod invocation #1260
base: unstable
Are you sure you want to change the base?
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 <661497+parthpatel@users.noreply.github.com>
* 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 <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
… issues. Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
…d packages. Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
…fy it explicitly in Makefile to fix 32-bit compilation issues. Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
…i386 compilation Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
…compilations Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
* Moved valkey-strtod.h back to src/ * Instead of passing OPT, STD etc from src/Makefile, fast_float Makefile explicitly specifies what it needs. Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
…interface Makefile Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
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 <madelyneolson@gmail.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Running ASAN, https://github.com/valkey-io/valkey/actions/runs/11966743688. |
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
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 <viktor.soderqvist@est.tech>
This is an alternative to this PR request by @swaingotnochill : #1170
This allows fast_float to remain a submodule that we can pull from for updates.
---- Update after the discussion
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.