Knowing about efficiency is one thing, increasing it is another
Increasing efficiency is extremely important in modern day computers. This is done in a variety of ways, from the design of components, to the process size, to the cooling solutions. I have previously talked about cooling, now I will talk about the design of components.
Computers would be nothing without the actual design of the circuits that make them up. These circuits are incredibly complex. The tasks computers must handle get more varied by the day, and finding the most efficient ways to handle them can take massive teams of engineers. The basis of these operations is a transistor. A transistor is an electronic device that manipulates a flow of electricity, they usually have three connection points. These connections are a source, a transistor, and a gate. The source provides the electricity, but it is only allowed to go through to the sink if the gate is powered as well. By combining these we can make a simple logic gate. Logic gates typically have two inputs and one output. The most simple logic gate is an “and” gate, where both inputs must be on for the output to be on, this can be achieved with a transistor alone. An “or” gate can be achieved with 3 transistors. Two are used for “and” inputs, and those inputs are used as the gate in the third transistor. A CPU can have billions of these transistors, AMD’s Ryzen series has around 4.8 billion. There is much more to CPU’s than just raw data processing, there are different modules that do things like hold data for later interactions. This adds even more layers of complexity, those 4.8 billions transistors each have their own role to play after all.
Increasing the efficiency of the circuits within CPU’s themselves happens all the time. CPU actions are not instant, but are instead defined by power cycles, the max cycles per second varies even between individual CPUs, and even more so between different designs. Typical desktop grade CPUs can usually hit at least 4 billion of these cycles a second. With each of these cycles a CPU processes different commands. The speed of this is measured in instructions per cycle. Between each generation of CPUs there is almost always a difference in instructions per cycle, or IPC for short. One of the more simple operations within a CPU is floating point operations, which involve multiplying, dividing, adding, and subtracting numbers with something after the decimal point. A modern CPU can do this multiple times in one cycle, AMD ryzen can do this 16 times each cycle, for example. The raw output of a CPU isn’t all that matters, the time it takes to move data around and wait for the next command has a massive impact as well. Not every cycle will be filled with actions, moving data from ram can takes hundreds of these for example.
Raw efficiency isn’t enough. As CPUs get more advanced so does their predictive technology. When it takes a long time to load information from memory, loading it before you actually need it can save a massive amount of time. This is done through the aid of something called an instruction pipeline. An instruction pipeline is what helps keep a CPU as busy as possible during its execution by breaking down tasks into different steps. These individual steps can often be done in different orders for a different level of efficiency in different situations. Branch prediction is one example of this. Branch prediction involves a CPU guessing what to do before an if/else statement. In these statements two completely different pieces of code may be executed based on the inputs, so efficient prediction is important. Some forms of branch prediction will start computing both possibilities, and then discard the incorrect one once it is determined.
The only way to increase efficiency in this area is to use the newest and most efficiently made components made by professionals, there isn’t much you can do personally that affects this. There are often incremental improvements over time, but these have a limit. At one point one of the best ways to get more out of a CPU was to find a way to increase the clock speed generation over generation. This seems to be slowing down, so new technologies are becoming a necessity, like AMD’s infinity fabric, which allows inter-core communication of CPU’s to happen much faster, and scale better. Instead of one massive CPU it can be split into smaller packages that can scale. One way to increase efficiency is reduce the overall amount of components besides a CPU that are needed, two 8-core CPUs are less efficient overall than one 16 core CPU with that technology.