Open zamazan4ik opened 8 months ago
This is very interesting! I will rerun the benchmark with PGO (with profile data form test runs) and see the results! PLO is also super interesting but is a different beast! Right now, we use zig
as a cross compiler. Since LLRT is a fully static build using musl libc, we can probably use musl sources and clang-15 directly (since it may come with bolt) and apply both PGO, PLO and LTO 🥇
Hi!
I tried to apply Profile-Guided Optimization (PGO) to optimize
llrt
performance further (as I already did for many other projects - see all current results here). I performed some basic benchmarks and want to share the results here.Test environment
main
branch on commitc040bfd05a2be8d3300e7a1bbfc9405c42a865fa
Benchmark
As a benchmark, I use the same command as I found in the Makefile -
llrt fixtures/hello.js
. The same scenario is used for the PGO training phase. All PGO optimization steps are done with cargo-pgo tool. PGO instrumented version is built withcargo pgo build
, PGO optimized version -cargo pgo optimize build
.taskset -c 0
is used for reducing CPU scheduling influence on the results.Results
I got the following results:
, where
llrt_release
- usual Release version,llrt_optimized
- PGO-optimized version.I ran the benchmark multiple times, with different command orders, etc - in all cases, the PGO-optimized version was faster than the usual release version. However, it would be awesome to perform some more precise benchmarks.
Further steps
I can suggest to do the following things:
I hope these benchmark results can be interesting to someone.