Skip to main content

Course 2

Understanding Slowness

Slow Web Server

ab - Apache benchmark tool

ab -n 500 site.example.com

Profiling - Improving the code

A profiler is a tool that measures the resources that our code is using, giving us a better understanding of what's going on.

  • gprof : For C program
  • cProfile : For Python program
  • pprofile3 + kcachegrind(GUI) : For Python program
  • Flat, Call-graph, and Input-sensitive are integral to debugging
  • timeit (python module) : Measure execution time of small code snippets