"What scientists must know about hardware to write fast code"

The aim of this tutorial is to give non-professional programmers a brief overview of the features of modern hardware that you must understand in order to write fast code. It will be a distillation of what have learned the last few years. This tutorial will use Julia because it allows these relatively low-level considerations to be demonstrated easily in a high-level, interactive language.

https://viralinstruction.com/posts/hardware/

Table of contents:

  • What this notebook is not
  • Setting up this notebook
  • The basic structure of computer hardware
  • Avoid accessing disk too often
  • Avoid cache misses
  • Keep your data aligned to memory
  • Digression: Assembly code
  • Allocations and immutability
  • Registers and SIMD
  • Struct of arrays
  • Specialized CPU instructions
  • Inlining
  • Unrolling
  • Avoid unpredicable branches
  • Be aware of memory dependencies
  • Variable clock speed
  • Multithreading
  • GPUs

The site, viralinstruction.com, only has two articles, but the domain name sounds promising. :slight_smile:

1 Like

Great blog! I finally finished reading the rather long but very interesting posts. Much of it is beyond me, but it’s good inspiration to learn more about hardware, assembly, and other low-level stuff.

1 Like