Skip to the content ForoHackers
Log inJoin

Performance engineering: start here

Performance engineering
#3391 · · Quote · Report

Performance engineering is the practice of making software use less time, memory, energy or bandwidth, guided by measurement rather than guesses. Most programs spend nearly all their time in a small part of the code, so the skill is finding that part, understanding why it is slow and changing the right thing.

Key concepts

  • Measure first: profile before changing anything; intuition about bottlenecks is often wrong.
  • Algorithms and data structures: a better complexity class beats any amount of tuning.
  • Memory hierarchy: caches mean access patterns matter; contiguous, predictable data is fast.
  • Concurrency and parallelism: using several cores helps only when work divides and contention is low.
  • Latency and throughput: how long one request takes, versus how many are done per second.

Vocabulary

  • Profiler: a tool that shows where a program spends time or memory.
  • Hot path: the code run most often or longest.
  • Cache miss: an access that has to go to slower memory.
  • Amdahl's law: the limit that the serial part of a task puts on speed-up from parallelism.

What to study, in order

  1. Complexity analysis and how to read a profile and a flame graph.
  2. Profile a slow program of your own, find its top cost, fix it and re-measure.
  3. Rewrite a loop for cache-friendly access and measure the difference.
  4. Learn the system's counters and tracing tools to see CPU, memory, disk and network use.
  5. Parallelise a task, then find where contention or waiting limits the gain.

Related tags

#performance-evaluation #algorithms #computer-architecture #web-performance #observability

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply