SIMD
Single Instruction, Multiple Data
ELI5 - The Vibe Check
SIMD is a CPU trick where instead of adding two numbers at a time, the processor adds eight, or sixteen, or thirty-two pairs of numbers in the exact same instruction, all at once. It's why a loop that does the same simple math over a big array of numbers can suddenly run several times faster once the compiler figures out how to vectorize it.
Real Talk
SIMD is a class of CPU instructions that apply the same operation to multiple data elements simultaneously using wide registers, for example adding eight pairs of 32-bit integers in a single instruction via AVX2. Compilers can auto-vectorize simple loops to use SIMD instructions automatically, and libraries for numerical computing, image processing, and machine learning rely heavily on hand-written or compiler-generated SIMD code for their speed.
When You'll Hear This
"The compiler auto-vectorized that loop into SIMD instructions, that's why it's so fast." / "NumPy is fast partly because it dispatches to SIMD-optimized C under the hood."
Related Terms
Benchmarking
Benchmarking is timing your code to prove it's actually fast, and it is shockingly easy to do wrong.
Branch Prediction
Modern CPUs don't wait around to find out if an if statement is true, they guess the answer and start executing down that path before they even know for su...
Cache Line
Your CPU never fetches just the one byte you asked for, it grabs a whole chunk around it, usually 64 bytes, called a cache line, on the theory that you'll...
Perf Counters
Perf counters are the CPU's own built-in scorekeepers, tiny hardware registers that silently count things like cache misses, branch mispredictions, and ins...