Opt in performance tweaks?

With CachyOS becoming very popular, I think many users would appreciate if similar tweaks were available as options on Manjaro, in the Hello menu as a suggestion. The goal is not to copy CachyOS but to make sure users don’t feel like they’re missing out on performance optimizations, while making use of Manjaro’s stability, user-friendliness and polish. Most things are easy to set up like zram or ananicy and there’s a ton of other small tweaks that can be included in a GUI just like how CachyOS does for their opt in tweaks. If not integrated in a menu, a guide could be written, perhaps, presenting the possible tweaks and the way of their installation.

While choosing between the two distros I did feel like I’m making a compromise on performance, with Manjaro being like a slower cousin to CachyOS. I realized though that CachyOS doesn’t generate more FPS in GPU-bound scenarios, as optimizations are more about responsiveness (which matters in competitive games) and RAM/CPU resource allocation. The only thing that can’t be replicated are the zen3/4 optimized repos.


A Manjaro performance kernel or some support for the CachyOS kernel (just providing a packaged version that’s compatible with the system’s versions) would also be interesting. In my testing Arch distros achieve better frames than Fedora or Ubuntu-based distros, so more attention to gaming would be appropriate. A gaming meta package could also be added and suggested in the Hello menu, installing Steam, Lutris, proton-ge (which is not in the repos), and so on. Just a proposal on how I think Manjaro would gain popularity.

Here’s the issue.

The primary enhancements are performance optimizations of the kernel, compiler and sys config levels - and they involve trade-offs in stability and hardware compatibility.

CachyOS has gone viral across Youtube/reddit, mostly for Gamer boyz… and is optimised only for more modern hardware profiles.

So you’re actually talking about building a stable house, and then undermining it…

Also, being ‘slower’ is very subjective - though it’s possible to measure 10 to 15% gains in SOME scenarios, this isn’t a game changer IMO. However, I think the changes you’re proposing would also increase the development overhead by quite a bit - and that’s not to be taken lightly either.

7 Likes

CachyOS is building kernels for specific architecture levels.

They do so by using compiler flags.

E.g. in a default makepkg.conf

CFLAGS="-march=x86-64 -mtune=generic "

Vs. one that is optimized for znver3

CFLAGS="-march=znver3 -mtune=native "

This has been optimized into buildbots and repository variations and scripts the makes it possible to point and click in CachyOS welcome.

And the CachyOS guys has done an incredible job in building the infrastructure behind this - they fill a gap - a niche - that is great, fantastic :slight_smile:

If you have a system that supports znver3 or znver4 or similar - you can compile an optimized Manjaro kernel - you can even use it side by side with your original Manjaro kernel - selectable from grub.

Here is a short how-to

Install the base-devel meta package

sudo pacman -Syu base-devel

Then copy the makepkg.conf to your home

cp /etc/makepkg.conf ~/.makepkg.conf

Modify the configuration file to use the optimization flags for your system

Then use the script-snippet from Can the "how-to-compile-the-mainline-kernel-the-manjaro-way" be revived? - #15 by linux-aarhus to build the kernel with your optimization.

6 Likes

From my experience with Gentoo - where everything, the kernel and every single program is compiled from source with the exact and optimized tweaks one wants -
I can tell you:
it is definitely not worth it when you have to do the work yourself (the time and energy put into compiling).
If someone else does it for you like in CachyOS apparently … o.k.

And the performance benefit might exist, but will be hardly noticeable in most situations.
(in the very low one digit percentage range at best)

One downside of such an optimized system:
you can’t deploy a backup of it on different or older hardware - it will simply not run.

9 Likes

I ran Gentoo for about 15 years. (Parts of me still even miss it!) Most of that 15 years I thought I was running actual optimised binaries for everything I did.

And sure there were certain things faster. Especially, when it was something like decoding/encoding, compression, hashing. or whatever niche task. But sometimes, without knowing, this can backfire, and make it even slower than doing it the regular x64 way.

Making the compiler smarter is always a massive part of the whole Linux ecosystem. I could be wrong, but I just don’t think they are there yet, at least for some architectures.

One article that I remember, that stood out for me anyway, was that Debian (running about 2 year older everything, including the kernel), was at least 20-some percent faster than Gentoo in every case they tested.

CachyOS makes you think you are optimised!

This article is 3 years old but still relevant to see some interesting numbers. And it has EndeavourOS, so you can get an idea where it sat vs Manjaro.

4 Likes

I always had the impression, that just using the optimized kernel is not enough for all the benefits and you actually need to also have the actual packages and programs compiled with those architecture optimization flags?

ALSO… could we somehow start “stealing” some of the CachyOS pre-compiled optimized packages in addition (or instead?) to the ones we steal from Arch? :smile: (at least v3)

CachyOS is very explicit, that using their packages outside CachyOS is not allowed.

I have seen discussions somewhere on the internet - in this forum perhaps about said policy.

That is correct - but even that - as suggested by above Phoronix test may not be enough.

Yes, to really notice a difference, the whole system would have to be explicitly compiled for your processor architecture, and you would also have to link certain things statically into the kernel — as opposed to as loadable modules — while also leaving out things you don’t need.

It is this principle that Gentoo was created for. In Gentoo, you start off with a very basic install of binaries, but then you rebuild that with your own compiler flags and other optimizations, and you build (almost) everything else from sources in the same manner.

The problem however is that by the time you’re done compiling everything, you can start all over again, because there will already be a newer version out. :grin:

3 Likes

Yes, 3 years is a long time and you could have linked something a bit more recent, to see “todays” expected performance differences.

aaaand ofc there are different kind of “optimizations”. when just pure “MOARRR FPS” looks nice on graphs, the real UI responsiveness and sharpness (with the cost to some fps even) is quite often more important… even in gaming.

Surprisingly mr.Phoronix never benchmarks any actual games… :man_shrugging:t2: just some laboratory server tests …

My original point was not the packages, as it’s hard to maintain, but suggesting to users a collection of simpler tweaks, as to have something to make them not miss out the optimized experience completely. For example, as mentioned, I’ve set up ananicy with CachyOS’ rules and zram, using a few commands, and I’ve also noticed the tweaks in CachyOS’ Hello menu as in the screenshot, which also seem like easy install. This is what I know about but there’s probably more similar stuff.
I do think that a patched kernel would be useful, with the BORE scheduler and so on. I built the CachyOS kernel from AUR but I was getting lag spikes with it, even though I was on Manjaro unstable.