Every line you have written so far has run on something. Not a metaphor, not “the computer” — a board with parts soldered to it, each doing one job, in a case you could open with a screwdriver. Knowing which part does what turns a slow program from a mystery into a question with an answer.

The parts, and what each one is actually for

PartWhat it doesWhat it means when it is the bottleneck
CPUFetches an instruction, does it, fetches the nextYour loop is doing too much arithmetic
RAMHolds what is open right nowYour list is bigger than the memory it has
CacheA small, very fast copy of what the CPU just usedThe same data, read over and over, is nearly free
Storage (SSD or hard drive)Keeps files when the power is offReading a file inside a loop is punishing you
MotherboardConnects everything, sets what fitsYou cannot simply add a faster part
Power supplyTurns wall power into what the parts needThe machine dies under load, not at rest
Video cardDraws things, and does wide parallel arithmeticGames and machine learning, not your for loop

RAM is where the confusion usually is. It is not storage. Everything in RAM disappears the moment the power does, which is why Files and Persistence exists at all: writing a file is the act of moving something from the part that forgets to the part that does not.

What happens when your program runs

The parts split the work in a fixed order, and it is worth being able to narrate it:

  1. Your file is on storage, as text.
  2. Running it copies what is needed into RAM, because the CPU cannot reach storage directly at any useful speed.
  3. The CPU fetches one instruction at a time, decodes it, and does it — arithmetic and comparisons in its own circuits, using registers and cache for the values in play right now.
  4. print() hands bytes to the operating system, which hands them to the screen.
  5. input() waits — the CPU has nothing to do until a key arrives, which is why a program that feels slow is often just waiting for you.
total = 0
for value in readings:      # each pass: fetch, compare, add, jump back
    total = total + value   # CPU and RAM, thousands of times a second

That loop is the whole cycle in miniature. Every pass is the CPU fetching, deciding, and storing, with readings sitting in RAM the entire time.

Where to look when something is slow

Ask which part is being asked to do too much. A program that crawls while the fan is silent is usually waiting on storage or on a person. A program that crawls with the fan roaring is doing real arithmetic — and that is a signal to look at your algorithm, not your hardware. Testing and Debugging is where that measurement habit lives.

Curriculum connection

C1.1

relate the specifications of the internal components of a computer (e.g., CPU, RAM, ROM, cache, hard drive, motherboard, power supply, video card, sound card) to user requirements;

Link to original

C1.4

identify the computer components involved in executing programming operations (e.g., assignment statements store a value in RAM, arithmetic operations are performed in the CPU).

Link to original