💾 Archived View for yujiri.xyz › software › guide › anatomy.gmi captured on 2023-09-08 at 16:35:10. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-06-14)
-=-=-=-=-=-=-
Learn programming for good instead of profit
Let's go through some of the hardware (physical) components of a computer.
The tradeoff between memory and storage (other than storage being able to persist without power) is that memory is much faster to access than storage, but storage is much cheaper to build with a larger capacity, hence most computers have 8 or 16 GB of memory and a few hundred GB of storage.
There are actually other levels of this tradeoff. The processor has a tiny bit of memory stored right inside it, which is even faster for it to access than main memory, but more expensive to build, which is why it only has a tiny bit.
Caching is an important thing computers do to improve the performance of memory access. When the computer loads something from a slow place (like storage), it also stores a copy of it in a faster place (like main memory). The benefit is that the next time that data needs to be accessed, it doesn't have to be loaded from storage again. This is why, for example, if you start a big program like a web browser for the first time after booting a computer, it'll probably take a few seconds because it's loading all the relevant files from storage, but if you close it and open it again, it opens much faster because it's loading from memory.
Caching in used in other places too. For example, web browsers usually cache pages you've visited into files on your storage disk, so if you load the same page again (and the website confirms it hasn't changed since), it doesn't need to redownload it all.