Skip to content

Instantly share code, notes, and snippets.

@weitsang
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weitsang/dd7e80d2260305a6aab4 to your computer and use it in GitHub Desktop.
Save weitsang/dd7e80d2260305a6aab4 to your computer and use it in GitHub Desktop.
On Software Performance

On Software Performance

Importance

  • "“People will visit a Web site less often if it is slower than a close competitor by more than 250 ms.”" from NY TImes
  • "the Apple iPhone 5 still has a dual core processor and 1 GB DDR2 RAM. But the magic is iPhone 5 is performing as good as any latest muscle Android phone" Silicon Station

Rules of Optimization

  • Don Knuth says, "Premature optimization is the root of all evil."
  • Ken Beck says, "Make it run, make it right, then, make it fast."

Latency Numbers

Examples of Performance Issues

  • Unnecessary disk I/O
  • Unnecessary memory copies
  • Unnecessary SQL / database access
  • Unnecessary network communication
  • Unnecessary locking
  • Unnecessary format conversion
  • Too many indirections
  • Unexpected interactions between system components
  • Compiler options
  • Bad data structures or algorithms
  • Memory leaks / garbage collection

Common Tricks for Performance Improvement

  • Pre-computation
  • Caching
  • Prefetching
  • Pipelining / Parallelizing
  • Make things feel faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment