English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 2h 5m | 234 MB
By optimizing your Python code, you can ensure that your code uses fewer resources and runs faster than it did previously. In this advanced course, explore tips and techniques that can help you optimize your code to make it more efficient. Instructor Miki Tebeka covers general tools of the trade, including how to leverage the tools Python provides for measuring time, and how to use line_profiler to get line-by-line profiling information. Miki also shares how to pick the right data structures, how approximation algorithms can speed up your code, and how to use NumPy for fast numeric computation. He wraps up the course with a discussion of how to integrate performance in your process.
This course is integrated with GitHub Codespaces, an instant cloud developer environment that offers all the functionality of your favorite IDE without the need for any local machine setup. With GitHub Codespaces, you can get hands-on practice from any machine, at any time—all while using a tool that you’ll likely encounter in the workplace. Check out the “Using GitHub Codespaces with this course” video to learn how to get started.
Table of Contents
Introduction
1 Welcome
2 What you should know
3 Use Codespaces with this course
Tools of the Trade
4 Always profile first
5 General tips
6 Measuring time
7 CPU profiling
8 line_profiler
9 Tracing memory allocations
10 memory_profiler
Picking the Right Data Structure
11 Big-O notation
12 bisect
13 deque
14 heapq
15 Beyond the standard library
Tricks of the Trade
16 Local caching of names
17 Remove function calls
18 Using __slots__
19 Built-ins
20 Allocate
Caching
21 Overview
22 Pre-calculating
23 lru_cache
24 Joblib
Cheating
25 When approximation is good enough
26 Cheating example
Parallel Computing
27 Amdahl’s Law
28 Threads
29 Processes
30 asyncio
Beyond Python
31 NumPy
32 Numba
33 Cython
34 PyPy
35 C extensions
Adding Optimization to Your Process
36 Why do we need a process
37 Design and code reviews
38 Benchmarks
39 Monitoring and alerting
Conclusion
40 Next steps
Resolve the captcha to access the links!