Post

Types of software optimisations

CPU Bound

  • Better data structures (searching) and algorithms (sorting)
  • Minimisation of in-loop tasks, parallelisation
  • Better compilation/low-level optimisations
    • Move closer to hardware (NumPy/C, Numba, Cython)
    • Faster hardware (GPU, TPU)

I/O Bound

  • I/O (disk, network, etc. ) access optimisation
    • File formats ( .parquet for tabular, .zarr for arrays)
  • Compression (when over network)
  • Parallelisation

Memory Bound

Programmer Bound

  • Code readability, styles, etc.
  • Use of libraries
  • Parallelisation (teamwork)

Profiling: For an accurate measurement, the benchmark should be designed to have a long enough execution time (in the order of seconds) so that the setup and tear-down of the process is small compared to the execution time of the application.

Jeff Dean Tips: https://static.googleusercontent.com/media/research.google.com/en/us/people/jeff/stanford-295-talk.pdf

This post is licensed under CC BY 4.0 by the author.