Evaluate Profile-Guided Optimization (PGO) usage for Valkey #64
Replies: 1 comment 1 reply
-
PGO is great if you have an automated suite representing your live traffic to run during the "profile" phase. It basically figures out which loops are hot vs. cold for more efficient code layout combined with which functions get called from which contexts for potentially better inlining without needing annotate everything with likely/unlikely or inline everywhere. The main trick is just having a representative run of the binary for the profiling phase though. Sometimes just running a test suite over the binary isn't great since the test suite will try to use every feature and error condition equally, but if you want to actually optimize based on a runtime profile, you want your profile runs to have more production command use cases so the happy paths have improved code layout and cache sizing more strongly than rare error conditions. |
Beta Was this translation helpful? Give feedback.
-
Hi!
Originally the idea (with corresponding benchmarks) was posted in the Redis issue tracker: redis/redis#12371
The idea is to enable Profile-Guided Optimization (PGO) for Valkey. Corresponding benchmarks for Redis can be found here: https://github.com/zamazan4ik/awesome-pgo/blob/main/redis.md .
What next can be done in this area? Maybe evaluate in more realistic cases. If maintainers decide that feature is important enough for Valkey's performance - add a corresponding build flag (
make
command I guess) and write some notes in the documentation about PGO effects in Valkey's performance.I fully understand that currently there are more important tasks to do since this project is too young. I post this idea here just as a possible improvement in the future. If Redis is not interested enough in the feature (according to the activity) - maybe Valkey will?
Beta Was this translation helpful? Give feedback.
All reactions