Introduction
Introduction
Code that works can still run too slowly. A function that handles 100 items quickly might take far too long with 1 million items.
Performance describes how fast your code runs and how that speed changes as the amount of data grows. Benchmarking means measuring how fast code runs so that you can compare versions and find what to improve. This module teaches you to:
- Explain why some code runs faster than other code.
- Measure how fast your code runs.
- Find the parts of a program that cause delays.
- Improve the code that matters most.
- Use the debugger to find why optimized code returns the wrong result.
You don't need to optimize everything. The goal is to know which code is worth the effort, and to base that decision on measurements instead of guesses.