I see these terms thrown around a lot when people talk about games. Like the developers don’t care about optimizing this game or that game. Or that Chrome is bloated, or Windows is bloated.
What do they actually mean? Why don’t developers always use optimization?
Comments
It takes a lot of time to optimize things. In the old days you could make reasonable assumptions about what coding would be optimal. Those assumptions largely do not apply to modern CPUs. So the only real reasonable way to making things more optimal is profiling – running the code and timing it, then adjusting the slow parts. To do this you need to have the software mostly finished. And when it is mostly finished, managers come in and say “ship it”. Developers want to make thing more optimal, but people that pay their salary generally don’t want to pay for that.
Similar things apply to memory consumption. You need to occasionally stop and evaluate parts of the system that consume the most memory and try to optimize that. Once again, it takes a lot of time.
And then once you optimized all low hanging stuff, you will start running against optimizations for specific CPU micro-architectures. But this a very low level and most software will be fine with just basic high level optimizations.
Most of modern software is also built from libraries. If the library is poorly written, then your options are to either eat it, find another library, or rewrite it. Other libraries may not be much better and rewriting takes time and effort.
Been a dev for 15 years.
Sometimes you don’t have time to optimize things, so you just ‘copy and paste’ stuff you should be turning into templates. I run into this a lot. All of a sudden my time table gets moved up and the hours I set aside for optimization get eaten into.
No one that controls the money above me gives a single crap that I got to do the job faster as long as its done and meet specs, optimized or not. Optimizing isn’t making anything new in their eyes.
Code is not optimized by default. A developer’s goal is to get it to work, not make it the fastest. However, eventually that catches up with you. It takes time to fix it, which many companies are not willing to spend.
Bloat is when a lot of unnecessary features are added to a software that only a small fraction of users use. These also contribute to the poor performance and take time away that could have been spent on optimizing.
Unoptimized software basically means the code isn’t efficient or doesn’t make good use of your hardware like using way too much CPU for a simple task.
It takes time and effort to make efficient code, something which release cycles may not want to deal with.
If you can paint a fence by chucking 2 tins of paint over it in half an hour, or spend a day carefully painting it with a brush and only using half a tin, which would you rather do? And if you were paying someone else to do it, which would you want?
Back in the past, where you had to make every megabyte count, or every kilobyte, and in some cases even every byte, people were careful and clever with efficiency. Now you have gigabytes of RAM, terabytes of storage, people don’t care about using a giant library to do a simple task, or about making some clever way to do something in a fraction of the size
The issue with PC gaming, compared to Console gaming is that the developers don’t know the exact makeup of every computer that will run it. On Consoles, they all have the same exact hardware, so the devs know exactly where they can push the machine a little harder, and where to pull back the demand. These are essentially shortcuts you can take if you know exactly what machine il the game will be running on.
Since every thing that happens in a game is made up of millions of calculations per second every shortcut you can take makes a big difference.
Now on computers, there is no standard that all machines have, so the devs cannot take those special shortcuts as much. They can put in extra time and effort to cover a large swathe of potential machines and make it run faster and more efficiently. However, this takes a lot of time and testing, and time is money.
This term is wildly thrown around all the time and is used incorrectly more often than that.
In short those terms refer to the idea that developers use inefficient methods of doing things because the hardware is orders of magnitude better now than before so they don’t have to write “good code”.
In practice devs use perfectly performant ways of doing things there are just many many many more things possible to do.
If we were to accept that there is some inefficiency due to those lazy developers then an example would be for instance how words are searched (think auto complete). An inefficient way would be to go through a list alphabetically from the start to find a word. Where a more optimal but massively more difficult would be to put each “pre word” ( set of letters that don’t make a word themselves, think “thi”) in a bucket first and then from the pre words to find the corresponding words.
In the old days developers needed to do things hyper efficiently because the hardware was not as good as it is today.
Image a game code being a recipe for a meal.
„Go buy potatos. Cut them thin. Go buy onions. An the way back pat the cat sitting at the front yard. Cut the onions“
The recipe is bloated, since petting the cat does nothing. Maybe it did something, maybe it does something but does not bring you closer to a freshly cooked meal. It’s just ballast (for the user at least. The author maybe likes you petting cats, maybe he is one or he uses the cat to collect your dns…)
Also the recipe is not optimized: why do you have to go to the store a second time? Why not go once and buy everything? Is it because the author was lazy and never reread the recipe? Rewriting may cost a few hours of rewriting or the author is unable to optimize since he has to use a command „bring bag to store“ but doesn’t know this line exists.
So the recipe is unnecessary complicated, not optimized and bloated with stuff you don’t want or need, bust the author don’t care because you bought his cooking book anyway and as long as your supermarket is close by (you pc can run it) you don’t care enough to complain. And the cat is happy to get pet and maybe even pays the author to build more petting time into his cookbook and even hide the instruction…
When something like chrome or windows or whatever is bloated, it means it’s filled with a ton of features that very few people actually want or use or things that use up resources unnecessarily. Lots of people would rather have a ‘lite’ version and then install the extras they want rather than get 1001 extras and only need 5 of them.
Unoptimized is when something doesn’t run very well when it is expected to. For example when a console game gets a PC release and the PC release runs worse on a high end computer than it does on console. This would be unoptimized. Or when a game doesn’t run very well even on the lowest settings. It could be down to a million different issues none of which I’m even remotely qualified to comment on but that’s the jist of it. It hasn’t been optimised/tuned to run well across a broad spectrum of different systems.
Those terms are different, but occasionally related.
“Bloat” means that software is bigger and usually slower than it needs to be. That might mean the length of the source code, the size of the executable, and/or the amount of RAM it takes to run (those are correlated).
“Unoptimized” means that things are done in inefficient ways, so the code takes more time and/or more memory to do its thing than necessary.
Optimization and bloat can interact with each other. It’s fairly common for code to be both bloated and unoptimized; e.g. it’s tracking and processing values that it doesn’t actually need because they won’t affect the final outcome. That’s more code, more RAM, and more time. In rare cases optimized code might actually be longer and use more RAM, but less time. e.g. if you’re sorting enormous lists, radix sort is faster than quick sort, but takes more code to write and more RAM to run.
In the arena of gaming, the interaction of time and RAM usage dominates efficiency conversations. Nobody wants to have to buy a supercomputer to run their games, and nobody wants their games to run at a snail’s pace. This is why AAA games are almost always written in low level languages where the programmers have nearly perfect control of everything the program does. In other arenas, the difference between taking 5MB and running in 2 seconds vs taking 10MB and running in 1 second is nearly meaningless.
1+1 = 2 (Optimized)
(1 + 1 + 1 + 1 – 1 – 1) x 2 / 2 = 2 (Unoptimized)
Multiply that all by 100,000 and the computer/game ends up doing a LOT more work for the same task. This is simplified but the idea is the same.
Bloat – Malwarebytes
It used to be a scanning tool. Now it has 35 different features, services, paywalls, pro versions, and tools that nobody wants or needs. They just download it to do the one free scan and uninstall.
Software is a negotiation between what is easy for people to understand and what is fast for computers to run. Optimization is the process of making software fast, and usually that means making it harder for people to understand — and, importantly, harder to change.
If you optimize too early, and then requirements or priorities change, it may be too hard to keep the software fast while changing it. This can sometimes happen with games.
In my professional experience “developers don’t care” is incorrect. Most dev’s I’ve worked with love optimization work, if they are given time to do it. But sometimes they aren’t, and sometimes things change and the work is thrown out. At the end of the day, a developer’s job is to deliver something good enough in a short enough amount of time. And sometimes people get that balance wrong.
And FWIW, Chrome at least contains some the best optimized code of any software that exists (eg. the V8 Javascript engine). One tradeoff with optimization is that you can either make things faster or use less memory. When people say “bloated”, they often mean “uses too much memory”, and Chrome uses a lot of memory in part because it is fast.
Masters in CS & IT here.
Developing a program is hard, specially if it is a big one like a game or an OS. And also often you aren’t doing everything from scratch, as you rely on libraries, frameworks, toolkits, and other pices of software that does some of the work for you, and you only need to know how to use that thing. Not to mention that many times you have deadlines for submitting advancements of work
This in the end means more often than not programmers proritize making the program do what it needs, and leaving optimizations to future updates to it.
And bloat means adding more and more things to a program for the sake of it, making it slow and heavy, while deviating from the original purpose of it. It’s like if you wanted to make a simple knife, but got carried away and you ended up doing a swiss army knife. I mean, do you actually need in Windows and included MSN news panel that can be openened at any time?
That was one of the reasons why the developers of the UNIX OS (which is the grandpa of many OSes like macOS, the PlayStation and Nintendo Switch OS, and Linux) made a rule: instead of making a single program that does everything, make small programs that do one thing, and one thing only, but they do that thing perfectly. The Keep It Simple and Stupid principle (KISS).