Evaluate using more optimizations: LTO, PGO, PLO #147
zamazan4ik
started this conversation in
Ideas
Replies: 1 comment
-
You make some good points but we've actually just restarted developing our kernel from scratch for various reasons (hence the name change). For now I think we're good with the defaults that we have but once it's in a more complete state I think both LTO and PGO sound like things we should use. @Wrench56 is our tooling and devops lead so I'm curious to see what he thinks about it and also @xadaemon one of our most experienced maintainers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Found your project several days ago - nice work! Since the project says "CharlotteOS will leverage these concepts to be a modern, open-source operating system that exemplifies all of security, performance, flexibility, and ease of use with no compromises." (link), I think I can propose several interesting ideas about how the projects' performance can be improved. How critical performance questions at the current LMNR project lifecycle are ofc up to you ;)
I noticed that for Rust parts Link-Time Optimization (LTO) is not enabled for CharlotteOS. I suggest switching it on since it will reduce the binary size (always a good thing to have) and will likely improve the application's performance (a lot or not - it depends).
I suggest enabling LTO only for the Release builds so as not to sacrifice the developers' experience while working on the project since LTO consumes an additional amount of time to finish the compilation routine. If you think that a regular Release build should not be affected by such a change as well, then I suggest adding an additional
release-lto
(actual naming is completely up to you) profile where additionally to regularrelease
optimizations LTO also will be added. Such a change simplifies life for maintainers and others interested in the project persons who want to build the most performant version of the application. Using ThinLTO also should help).If you are ready to invest more resources into improving the project's overall performance, I can suggest taking a look at Profile-Guided Optimization (PGO) and Post-Link Optimization(PLO) - I write about them a lot in my repo: https://github.com/zamazan4ik/awesome-pgo (and this article). PGO and PLO are very promising optimizations in your case that can help to achieve 10-20% (or even more) performance wins to you. However, integrating them will be much more difficult task compared to enabling LTO (from my experience).
LTO and PGO are already integrated into the Linux kernel build pipelines (AFAIK, Windows too - from the Linux Plumbers conf) so maybe there you can try to find some inspirations, details about the integration of such technologies into the OS ecosystem, etc. Some benchmarks regarding PGO for operating systems are also available in the
awesome-pgo
repo.Thank you.
P.S. I created the Discussion in this repo. However, I think the same applies for other repositories in the project ;)
Beta Was this translation helpful? Give feedback.
All reactions