Compilers and Interpreters/What makes code fast?
What makes code fast?

Planned chapter | Dan Hollick

What makes code fast?

Performance emerges from the relationship between algorithms, data layout, processors, memory hierarchies and the optimiser.

What makes code fast? chapter cover
IN PROGRESS

The source chapter is still planned. This route preserves the collection and offers an original conceptual preview.

Performance emerges from the relationship between algorithms, data layout, processors, memory hierarchies and the optimiser. The apparent simplicity comes from a set of carefully chosen representations, transformations and physical assumptions working together.

algorithmdata layoutmachine workelapsed time

Complexity

Choosing less work usually matters more than making each instruction slightly cheaper.

This is one part of a longer chain: algorithm becomes data layout becomes machine work becomes elapsed time. The useful abstraction hides the physical work, but the underlying constraints still shape the software built above it.

Caches

Contiguous, predictable memory access keeps the processor supplied with nearby data.

The implementation is full of compromises. Precision, speed, storage and energy rarely improve together, so practical systems choose the errors people are least likely to notice.

Parallelism

Independent work can use vector units, multiple cores or a GPU—when coordination costs stay low.

Once this layer is visible, familiar design conventions stop looking arbitrary. They are accumulated responses to the capabilities and limits of the machinery below.

╌╌ END ╌╌
Next chapterQR and barcodes.

A visual study based on the original chapter. Text is condensed and rewritten.