One big difference that I’ve noticed between Windows and Linux is that Windows does a much better job ensuring that the system stays responsive even under heavy load.

For instance, I often need to compile Rust code. Anyone who writes Rust knows that the Rust compiler is very good at using all your cores and all the CPU time it can get its hands on (which is good, you want it to compile as fast as possible after all). But that means that for a time while my Rust code is compiling, I will be maxing out all my CPU cores at 100% usage.

When this happens on Windows, I’ve never really noticed. I can use my web browser or my code editor just fine while the code compiles, so I’ve never really thought about it.

However, on Linux when all my cores reach 100%, I start to notice it. It seems like every window I have open starts to lag and I get stuttering as the programs struggle to get a little bit of CPU that’s left. My web browser starts lagging with whole seconds of no response and my editor behaves the same. Even my KDE Plasma desktop environment starts lagging.

I suppose Windows must be doing something clever to somehow prioritize user-facing GUI applications even in the face of extreme CPU starvation, while Linux doesn’t seem to do a similar thing (or doesn’t do it as well).

Is this an inherent problem of Linux at the moment or can I do something to improve this? I’m on Kubuntu 24.04 if it matters. Also, I don’t believe it is a memory or I/O problem as my memory is sitting at around 60% usage when it happens with 0% swap usage, while my CPU sits at basically 100% on all cores. I’ve also tried disabling swap and it doesn’t seem to make a difference.

EDIT: Tried nice -n +19, still lags my other programs.

EDIT 2: Tried installing the Liquorix kernel, which is supposedly better for this kinda thing. I dunno if it’s placebo but stuff feels a bit snappier now? My mouse feels more responsive. Again, dunno if it’s placebo. But anyways, I tried compiling again and it still lags my other stuff.

-3 points

No. And even worse is Linux’s OOM behaviour - 99% of the time it just reboots the machine! Yes I have swap and zswap.

Linux is just really bad at desktop.

permalink
report
reply
3 points
4 points

This should work out of the box!

permalink
report
parent
reply
3 points
*

I haven’t had that experience. (Systemd oom)

permalink
report
parent
reply
-1 points

Yeah I think the philosophy of Linux is to not assume what you are going to be use it for. Why should Linux know where your priorities are better than you?

Some people want to run their rustc, ffmpeg or whatever intensive program and don’t mind getting a coffee while that happens, or it’s running on a non-user facing server anyway, to ensure that the process happens as soon as technically possible. Mind you that your case is not an “average usecase” either, not everyone is a developer that does compilation tasks.

So you’ve got a point that the defaults could be improved for the desktop software developer user or somehow made more easily configurable. As suggested downthread, try the nice command, an optimized scheduler or kernel, or pick a distribution equipped with that kind of kernel by default. The beauty of Linux is that there are many ways to solve a problem, and with varying levels of effort you can get things to pretty much exactly where you want them, rather than some crowdpleasing default.

permalink
report
reply
4 points

There’s a setting in windows to change the priority management, most people never see it.

By default it’s configured for user responsiveness, but you can set it for service responsiveness.

Though this is nothing like the process priority management in Linux, it’s one setting, that frankly I’ve never seen it make any difference. At least with Linux you can configure all sorts of priority management, on the fly no less.

Even with a server, you’d still want the UI to have priority. God knows when you do have to remote in, it’s because you gotta fix something, and odds are the server is gonna be misbehavin’ already.

permalink
report
parent
reply
1 point

Even with a server, you’d still want the UI to have priority. God knows when you do have to remote in, it’s because you gotta fix something, and odds are the server is gonna be misbehavin’ already.

That’s a fair point.

I still contend that regularly using processes that hog every available cpu cycle it can get its hands on was not a common enough desktop use case that warranted changing the defaults. It should be up to the user to configure to their needs. That said, a toggle switch like the hidden windows setting you described would be nice.

permalink
report
parent
reply
4 points

Why should Linux know where your priorities are better than you?

Because a responsive desktop is basic good UX that should never ever be questioned. That should at least be the default and if you don’t want your desktop to have special priority, then you can configure it yourself.

pick a distribution equipped with that kind of kernel by default.

I’m running Kubuntu, an official variant of Ubuntu which is very much a “just works” kind of distribution - yet this doesn’t just work.

permalink
report
parent
reply
1 point

What if I know it will compile for several minutes so I leave it alone to go office chair jousting? It would be fair to lock up the UI in this case.

permalink
report
parent
reply
2 points

Sure, it could lock up the UI if there is no input for a while I suppose. But if there is still input, then it should be responsive.

I believe it can achieve both.

permalink
report
parent
reply
-2 points

Ha, that’s funny. When I run some Visual Studio builds on Windows it completely freezes at times.

Never have that issue on EOS with KDE.

permalink
report
reply

While I ultimately think your solution is to use a different scheduler, and that the most useful responses you’ve gotten have been about that; and that I agree with your response that Linux distros should really be tuning the scheduler for the UI by default and let developers and server runners take the burden of tuning differently for their workloads… all that said, I can’t let this comment on your post go by:

which is good, you want it to compile as fast as possible after all

If fast compile times are your priority, you’re using the wrong programming language. One of Go’s fundamental principles is fast compile times; even with add-on caching tooling in other languages, Go remains one of the fastest-compiling statically compiled, strongly typed programming languages available. I will not install Haskell programs unless they’re precompiled bin packages, that’s a hard rule. I will only reluctantly install Rust packages, and will always choose bins if available. But I’ll pick a -git Go package without hesitation, because they build crazy fast.

Anyway, I hope you find the scheduler of your dreams and live happily ever after.

permalink
report
reply
8 points

I only said as fast as possible - I generally think the compile times are fine and not a huge problem. Certainly worth it for all the benefits.

permalink
report
parent
reply
6 points

There’s no free lunch after all. Go’s quick compilation also means the language is very simple, which means all the complexity shifts to the program’s code.

permalink
report
parent
reply

That’s an interesting take - that Go program code is more complex than Rust - if I understood you correctly. I came across a learning curve and cognitive load readability comparison analysis a while back, which I didn’t save and now can’t find. I haven’t needed it before because I think this is the first time I’ve heard anyone suggest that Rust code is less complex than Go.

Your point about the tradeoff is right, but for different reasons. Go executables have a substantial runtime (with garbage collection, one of those things that make Go code less complex), making them much larger and measurably slower. And then there’s Rust’s vaunted safety, which Go - outside of the most basic compile-time type safety - lacks. Lots of places for Rust to claim superiority in the trade-offs, so it tickles me that you choose the one truly debatable argument, “complexity.”

permalink
report
parent
reply
4 points

Linux defaults are optimized for performance and not for desktop usability.

permalink
report
reply
8 points
*

If that is the case, Linux will never be a viable desktop OS alternative.

Either that needs to change or distributions targeting desktop needs to do it. Maybe we need desktop and server variants of Linux. It kinda makes sense as these use cases are quite different.

EDIT: I’m curious about the down votes. Do people really believe that it benefits Linux to deprioritise user experience in this way? Do you really think Linux will become an actual commonplace OS if it keeps focusing on “performance” instead of UX?

permalink
report
parent
reply
-5 points

“Desktop” Linux exists in this state for decades. Who cares? Maybe we won’t have consumer desktops as a niche soon. Existing users are fine with that. Don’t say you are waiting that Linux will become “a viable desktop OS alternative” in next few years.

It’s also not about “desktop and sever variants”. Desktop Linux is either conservative or underresourced. Conservatives will told you that you are wrong and there is no issue. And they are major Linux zealots. For the other side someone need to write code and do system design, and there are not many of people for that. So, it’s better not to expect a solution anytime soon, if you are not planning to work on it by yourself.

permalink
report
parent
reply
5 points
*

“Desktop” Linux exists in this state for decades. Who cares?

I mean, I’d like to think a lot of people care? I think a lot of people in this community would love if Linux was more widespread and less niche.

Maybe we won’t have consumer desktops as a niche soon. Existing users are fine with that.

“Existing users” are not fine with that (I am also an existing user). But even if they were, that is not an attitude that will make Linux into a Windows/macOS competitor.

Don’t say you are waiting that Linux will become “a viable desktop OS alternative” in next few years.

We need a viable desktop alternative today or very soon more now than ever before. Microsoft is tightening the noose on Windows 11 and introducing more and more enshittification. Apple also announced AI partnerships recently. We need alternatives.

It is not good for society for operating systems to be boiled down to two mega-corporate choices. An OS is not something that can be easily made - this is not a space that a competitor can quickly enter and shake things up. If we don’t push MS/Apple off the throne, Linux will stay niche forever and society will suffer.

permalink
report
parent
reply
3 points

Linux is already a popular and viable desktop OS - for its target audience.

The downvote comes from you implying people cannot dev in Linux when its the platform of choice for this workload.

Now surely the user experience could be polished, but advanced users are at this point used to the workflow, and basic ones will stick to Windows out of inertia no matter what. Therefore the incentive for improving this kind of things is extremely low.

permalink
report
parent
reply
2 points

That might be the case, but that makes me sad though. That implies that Linux is only targeting technical people who are willing to tinker with all these things themselves.

I would personally want Linux to be broader than that. I’d want it to be the option for everyone - free computing shouldn’t be limited to technical people, it should be provided to all.

permalink
report
parent
reply

Linux

!linux@programming.dev

Create post

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

Community stats

  • 2.4K

    Monthly active users

  • 600

    Posts

  • 4.8K

    Comments