YoVDO

Faster Python Code

Offered By: LinkedIn Learning

Tags

Python Courses NumPy Courses Data Structures Courses Parallel Computing Courses Code Optimization Courses Code Efficiency Courses Numba Courses Cython Courses

Course Description

Overview

Learn tips to help optimize your Python code. Discover how to pick the right data structures, use caching, integrate performance in your process, and more.

Syllabus

Introduction
  • Welcome
  • What you should know
  • Use Codespaces with this course
1. Tools of the Trade
  • Always profile first
  • General tips
  • Measuring time
  • CPU profiling
  • line_profiler
  • Tracing memory allocations
  • memory_profiler
2. Picking the Right Data Structure
  • Big-O notation
  • bisect
  • deque
  • heapq
  • Beyond the standard library
3. Tricks of the Trade
  • Local caching of names
  • Remove function calls
  • Using __slots__
  • Built-ins
  • Allocate
4. Caching
  • Overview
  • Pre-calculating
  • lru_cache
  • Joblib
5. Cheating
  • When approximation is good enough
  • Cheating example
6. Parallel Computing
  • Amdahl's Law
  • Threads
  • Processes
  • asyncio
7. Beyond Python
  • NumPy
  • Numba
  • Cython
  • PyPy
  • C extensions
8. Adding Optimization to Your Process
  • Why do we need a process?
  • Design and code reviews
  • Benchmarks
  • Monitoring and alerting
Conclusion
  • Next steps

Taught by

Miki Tebeka

Related Courses

Intro to Computer Science
University of Virginia via Udacity
Design of Computer Programs
Stanford University via Udacity
Analytic Combinatorics, Part I
Princeton University via Coursera
Algorithms, Part I
Princeton University via Coursera
Algorithms, Part II
Princeton University via Coursera