One of the key things to know about computers is that not everything runs at the same speed.
This can lead to some nasty security vulnerabilities and accuracy and stability issues.
One of the slowest components in a computer is the HDD.
HDDs are slow because they have mechanical moving parts, a spinning disk, and an actuator read/write arm.
Conversely, the CPU is the fastest component of a computer.
This would generally result in a significant amount of data loss and complete corruption of the data.
An intermediate memory gadget is used as a buffer to get around this issue.
The data can then be sent over the SATA bus to the HDD from the system RAM.
On the actual HDD, another set of memory acts as a read/write buffer.
The data can be stored temporarily until the drive is ready to write it to the spinning disk.
Buffers also allow for optimizations of both read and write operations.
Contents
Optimizations
Lets consider a scenario where three operations must happen on an HDD.
The data is read in the third operation directly following the data being read by the first operation.
This isnt an issue if these operation instructions have enough separation.
However, if they are queued up simultaneously, there are some noticeable performance issues.
This essentially leaves the disk idle for the seeking time and significantly delays the third operation.
Without a proper or large enough buffer, performing these operations in order would be necessary.
The operations can be optimized with a large enough buffer to store the relevant data.
This then applies a minimal delay to the second operation while significantly speeding up the third.
Here the buffer directly increases the performance of the drive by enabling optimizations.
A modern computer screen works by displaying many pictures on the screen every second.
Typically 60 distinct photos are used as this allows for smooth motion perception.
These images are written to the screen progressively from top to bottom.
Though the write time is short.
This may not be noticed on static content such as your desktop or an unmoving web page.
The tear is simply the switch between the previous and current image.
The effect can be very noticeable, distracting, and unpleasant.
By implementing a frame buffer, the computer can queue up the next frame to be displayed.
The screen can just read it when its ready.
However, a single buffer can lead to the GPU sitting idle.
Unable to start outputting the next frame as the monitor hasnt read the last one from the buffer.
Knowing that data in a buffer typically hasnt yet been protected from a power loss event is essential.