Extending of Profile-Guided Optimization (PGO) usage in Haiku

Hi!

Just read the article at Phoronix about ongoing developments in Haiku. Nice work!

My eye was watched by the “Minor fixes and performance optimizations to the Haiku kernel code” line since I am a person who is interested in software optimizations. More specifically, I am trying to expand the usage of several compiler optimizations across the ecosystem: Link-Time Optimization (LTO), Profile-Guided Optimization (PGO), Post-Link Optimization (PLO, probably already heard about LLVM BOLT - that’s it). I collect all available materials about these optimizations (including a lot of benchmarks, especially for PGO-optimized apps) in my GitHub repo - awesome-pgo.

As far as I see, Haiku at least several years ago didn’t use PGO for its packages. Does the situation remain the same? Did you consider enabling PGO for more Haiku packages? The “awesome-pgo” repository and some heavily-optimized packages recipes from distros like CachyOS and ClearLinux can be good points to consider packages that benefit from PGO.

Another consideration point - optimizing the Haiku kernel itself with LTO and PGO. LTO and PGO are hot topics nowadays for the Linux kernel development since these optimizations bring measurable improvements to the Linux kernel performance. In “awesome-pgo” I have several benchmarks for that (Linux and Windows). Did you consider LTO and PGO usage for the Haiku kernel?

I hope you find these ideas at least interesting for the Haiku project. Maybe some of these ideas can be even converted into some GSoC work - who knows!

Thank you.

1 Like

FWIW, at least the Python packages are now built with PGO, and version 3.13.0 even has LTO enabled.

It is not always easy to get reliable builds with those options enabled, as some require too much RAM, or are too CPU intensive for the old hardware I use to do the updates for those packages, and also for the machines doing the HaikuPorts builds (at least in the past, I think those got better specs now), or cause some other forms of builds breakage on Haiku.

That’s as far as my experience goes, so, I’ll leave it there.

1 Like