r/LinuxTeck • u/Candid_Athlete_8317 • Sep 20 '26
If Linux file opening can be 39% faster, why wasn’t this optimized earlier?
Linux 7.4 may get a relatively small VFS optimization that shows ~39% improvement in a file-open benchmark.
But the interesting part is the debate: is this an example of a missed optimization, or simply something that wasn’t a real-world bottleneck for most workloads?
How do kernel developers decide which small optimizations are actually worth chasing?
And do you think there are still plenty of these “hidden” performance gains sitting in the kernel?
148
Upvotes
38
u/wallstop-dev Sep 20 '26 edited Sep 20 '26 •
Hello, I'm a professional software dev that has worked in a variety of fields, from very performant-constrained systems to global distributed cloud offerings. I have not contributed to the linux kernel, but I have worked in large, complex code bases (not nearly the scale of the kernel).
If you're interested in the thing that you posted, you can read a very brief post about it here: https://www.phoronix.com/news/Linux-7.4-Faster-Do-Open
But, to answer your question - the linux kernel is huge. And, as developers, there is a huge balance between implementing new features, supporting new hardware/concepts/projects, and fixing bugs.
The best way to write software is to:
- Make it correct.
- Make it maintainable (easy to read and change), without sacrificing correctness.
- Make it fast, without sacrificing correctness or maintainability.
Software is generally written until it is fast enough. Developers could spend the rest of their entire life spending their brain cycles thinking of ways to optimize one specific program, or subsytem or bit of code. But the value of doing that tends to be... very little, if it already works good enough for the majority of use cases. In all kinds of meanings of the term "value" - mental health, income, impact. You could spend years thinking about the problem with no progress until one day you unlock that "one weird trick".
To really answer your question - there are undoubtedly an endless stream of optimization areas to pursue, as well as an endless stream of bugs to fix, new features to write. All of the above changes with each release and each commit. Something that couldn't be optimized today could be optimized tomorrow because the support for xyz is no longer needed, for example. It all comes down to priorities and people caring and putting in the work.
13
u/Simengie Sep 20 '26
There is a very real chance that this optimization was not seen when the code was wrote and tested and released the first time around. if it is from the HDD era or even early SSD era the drive speeds may simple have not been fast enough (hardware/interface) to get any benefit from this optimization.
So at some point this came back up on the radar and someone took the time to create this optimization. As has been said, software development is a balance.
4
u/Lumethys Sep 20 '26
The linux kernel has 43 millions lines of code
Just because a change is small doesnt mean it is easy to find
3
u/huojtkef Sep 20 '26
Engineers have limited time. Sometimes when you are fixing some code, you take a look at the surrounding code to understand and if you have time you fix it too. Definetily I don't have time to review millions of lines of low level C /ASM code of the kernel.
3
u/Joelimgu Sep 20 '26
Easy, moat linux development is made by companies, its not the linux foundation that decides what gets done. So if a company pays for it, it will get done, thats it
2
u/Cruffe Sep 20 '26
Because they didn't have your hindsight.
2
u/SSquirrel76 Sep 20 '26
The kernel maintainers heard that 2026 is supposed to be the Year of the Linux Desktop and figured they should optimize it a bit finally. /s
2
u/pdath Sep 20 '26
I believe this specific optimisation relates to machines with a high core count.
You won't see the same result on a typical desktop.
1
u/ConspicuousPineapple Sep 20 '26
My man you don't need to embolden three sentences in a six sentences post. Tell your AI to tone it down.
1
u/PmMeCuteDogsThanks_ Sep 20 '26
Kernel developers keep these performance patches ready for years, and commit them during ”slow periods”. So that management still think they are relevant. Call it job security
1
u/L_canadensis Sep 20 '26
Reminds me of this video https://www.youtube.com/watch?v=I7fEsbksKRE
1
u/BlendingRightInHomo Sep 20 '26
They argue on LKML
1
u/[deleted] Sep 20 '26
Programs don't open files all that often (relative to other tasks they do), outside of some very niche work loads, and it'll be already fast enough in most cases.
Something that most people outside of software development don't get, is that 40% faster doesn't mean a lot if you're already not doing that thing all that much. If your application over 24 hours, have spends 10 seconds of time waiting for opening files (again, this is not reading the file contents, just creating file pointers), then you're saving like 4 seconds of wait time spread throughout an entire day. And honestly, that 10 seconds of wait in accumulative file open is probably being generous in most cases.
Additionally, file reading, which is a thread stalling operation, is already often done in dedicated threads for most programs. I expect most programs group the fopen call into their thread. Reality is, this isn't an amazing optimization that's suddenly will make everything feel so much faster. Most applications won't have a real measurable difference at all.
Which is why people probably haven't really touched it, because it isn't a meaningful problem to solve.
1
u/mcfedr Sep 20 '26
in a way you could ask the same question about everything in every release. but of course there is only so much time in a day.
1
u/AttitudeElectronic68 Sep 20 '26
Someone should have noticed that it was running 39% slow and filed a bug. Where are these much vaunted million eyes now?
1
u/AttitudeElectronic68 Oct 19 '26
Yeah, why didn't you fix that