Linux
Welcome to c/linux!
Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!
Rules:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
view the rest of the comments
Pre-calculation or calculation caching is about the best save you're going to get, but each and every piece of software would need to be rewritten with that idea in mind - assuming it wasn't already written that way in the first place - rather than it being something the system can impose.
It's plausible that someone could write or modify an OS that specifies to each program what they're supposed to do, be that optimise for time, optimise for CPU, optimise for RAM, etc. etc., but the program itself still needs to provide the ability to do each and every one of those, which is time and effort that program writers may not be willing to put in.
For a more concrete example, although still something of a toy, there's a program in the
bsdgamespackage calledprimesthat's ~80k in size.Clearly, at that size, it does not contain all prime numbers but it sure can generate more than 80k of them quickly. It is highly optimised code, if my efforts at beating it are anything to go by.
If you, as a hypothetical prime number aficionado, wanted even less work on your CPU, you could store your database of prime numbers in RAM (or disk) and not generate them over and over with
primes.primesdoes not do this. It is not written to do this. It could be, but then it would be a larger program to account for extra modes of operation, which is more work for the maintainers.