5 ms·
My first computers didn't do anything well. You would reboot the entire machine to load a game from a floppy disk which took forever. If that game crashed you'd
by agentultra 3y ago
My first computers didn't do anything well. You would reboot the entire machine to load a game from a floppy disk which took forever. If that game crashed you'd have to start all over again.
My current computer boots in seconds.
In my experience it seems a good deal of bloat has to do with resiliency. Most desktop applications don't completely crash the entire system when they contain a memory access bug. They just crash. That doesn't come for free.
Let's say you want to go outside and cross the street. In order to do that you need to put on your shoes and lace them up so that you don't trip and fall. You do this and while crossing the street one day you fall and discover that your lace came untied. In order to prevent this next time you decide you will look down after every step to make sure your shoes are still tied.
This is how a lot of modern software works: we check if our shoes are still tied.
One way to fight against this, I suspect, is that we have to think more clearly about correctness. Back when Multics and Unix were being developed under the same roof at Bell Labs the Multics folks were wringing their hands over error recovery: the kernel had several "rings" and handlers could be registered... but there were always edge cases. Unix on the other hand? Just let it crash. Since then there has been a lot of research and development into how to formally specify systems using precise, checkable proofs. I think there are certain kinds of performance gains we can only make when we don't have to keep checking if our shoes are tied and those can only come from languages and tools that let us formalize our programs.
This is not my idea, it's from Conal Elliot who's awesome and smart [0].
The other source of bloat is the kitchen-sink effect. Writing software is time consuming. Most businesses don't want their developers writing low level drivers and optimizing memory usage. They want to get a product in front of consumers and get paid because the business might not even be in business in 9 months if you don't start shipping and making revenue. Fortunately there are a great number of kitchen-sink software frameworks and stacks of libraries for most development tasks... which include more code and resources than your application will use... but again, convenience and speed dominate. The average phone in 2018 had something like 4GB of RAM and ~32GB of HDD space. If your app used up a gig of working memory and took up a gig of space but you got it out in a few months by hiring JS developers who knew react native for less than what it would cost to hire Swift/ObjC developers to write the perfect app from scratch? We know what most businesses will choose.
[0] https://www.youtube.com/watch?v=k6rY5Mvx84E&list=PLOvRW_utVPVmzDGGOJ2amgVBK168Vemke&index=3 https://www.youtube.com/watch?v=k6rY5Mvx84E&list=PLOvRW_utVP...
- gizmo 3y ago> In my experience it seems a good deal of bloat has to do with resiliency. Most desktop applications don't completely crash the entire system when they contain a memory access bug. They just crash. That doesn't come for free. This is provided by hardware and basically free. Besides, computers aren't slow because of kernel bloat. Linux, OSX and Windows have serious issues but all major software problems are in user space.
- agentultra 3y ago> The other source of bloat is the kitchen-sink effect. This is the "user space" bloat. Resiliency is one of those things that's baked into every layer of the stack seems to be cumulative. Research into lock-free algorithms in order to improve efficiency requires correctness and there are still places in the OS level and user space that would benefit from it.
- gizmo 3y agoI'm sorry but that is also wrong. Lock-free algorithms don't help much with performance. Locks are very cheap and your PC spends very little time spin-locking. Even interrupts and thread-switching (which is much more expensive) aren't that big of a deal nowadays.
- agentultra 3y agoDon't be sorry, I'm not the expert! I only found the idea somewhat convincing after watching Conal's talk and have been curious. Is there performance left on the table from adding resilience to systems in your view?
- gizmo 3y agoI don't think performance is at odds with resiliency. You can have one, both, or neither. Resiliency you get by eliminating entire categories of problems with strong conceptual abstractions. As you pointed out, virtual memory that protects applications from interfering with one another is one such example. Other examples are transactional databases (ACID), and perhaps software transactional memory. Statelessness also has fantastic resilience properties and is a big driver behind the success of web applications. Take sqlite for instance. sqlite is very resilient, gives you transactions that you can roll back, and on top of that, storing small files in a sqlite database can be faster than using the filesystem directly. You get resilience AND performance AND a boost in productivity. https://www.sqlite.org/fasterthanfs.html https://www.sqlite.org/fasterthanfs.html