Introduction
Welcome
(00:54)
What you should know
(01:18)
1. Tools of the Trade
Always profile first
(01:33)
General tips
(01:40)
Measuring time
(04:55)
CPU profiling
(06:54)
line_profiler
(05:07)
Tracing memory allocations
(03:53)
memory_profiler
(02:23)
2. Picking the Right Data Structure
Big-O notation
(02:30)
bisect
(03:18)
deque
(03:00)
heapq
(03:52)
Beyond the standard library
(05:15)
3. Tricks of the Trade
Local caching of names
(03:23)
Remove function calls
(03:16)
Using __slots__
(03:24)
Built-ins
(03:02)
Allocate
(03:06)
4. Caching
Overview
(02:46)
Pre-calculating
(02:37)
lru_cache
(03:03)
Joblib
(03:26)
5. Cheating
When approximation is good enough
(01:16)
Cheating example
(04:21)
6. Parallel Computing
Amdahl's Law
(04:13)
Threads
(02:56)
Processes
(02:59)
asyncio
(05:16)
7. Beyond Python
NumPy
(03:55)
Numba
(03:50)
Cython
(04:38)
PyPy
(02:05)
C extensions
(03:44)
8. Adding Optimization to Your Process
Why do we need a process?
(01:11)
Design and code reviews
(02:51)
Benchmarks
(03:15)
Monitoring and alerting
(02:41)
Conclusion
Next steps
(01:05)
Ex_Files_Optimizing_Python_Code.zip
(1.0 MB)