Book description
Your Python code may run correctly, but what if you need it to run faster? This practical book shows you how to locate performance bottlenecks and significantly speed up your code in high-data-volume programs. By explaining the fundamental theory behind design choices, this expanded edition of High Performance Python helps experienced Python programmers gain a deeper understanding of Python's implementation.
How do you take advantage of multicore architectures or clusters? Or build a system that scales up and down without losing reliability? Authors Micha Gorelick and Ian Ozsvald reveal concrete solutions to many issues and include war stories from companies that use high-performance Python for social media analytics, productionized machine learning, and more.
- Get a better grasp of NumPy, Cython, and profilers
- Learn how Python abstracts the underlying computer architecture
- Use profiling to find bottlenecks in CPU time and memory usage
- Write efficient programs by choosing appropriate data structures
- Speed up matrix and vector computations
- Process DataFrames quickly with pandas, Dask, and Polars
- Speed up your neural networks and GPU computations
- Use tools to compile Python down to machine code
- Manage multiple I/O and computational operations concurrently
- Convert multiprocessing code to run on local or remote clusters
- Deploy code faster using tools like Docker
Publisher resources
Table of contents
- Brief Table of Contents (Not Yet Final)
- 1. Understanding Performant Python
-
2. Profiling to Find Bottlenecks
- Profiling Efficiently
- Introducing the Julia Set
- Calculating the Full Julia Set
- Simple Approaches to Timing—print and a Decorator
- Simple Timing Using the Unix time Command
- Using the cProfile Module
- Visualizing cProfile Output with SnakeViz
- Using line_profiler for Line-by-Line Measurements
- Using memory_profiler to Diagnose Memory Usage
- Combining CPU and Memory Profiling with Scalene
- Introspecting an Existing Process with PySpy
- VizTracer for an interactive time-based call stack
- Bytecode: Under the Hood
- Unit Testing During Optimization to Maintain Correctness
- Strategies to Profile Your Code Successfully
- Wrap-Up
- 3. Lists and Tuples
- 4. Dictionaries and Sets
- 5. Iterators and Generators
- About the Authors
Product information
- Title: High Performance Python, 3rd Edition
- Author(s):
- Release date: May 2025
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098165963
You might also like
book
High Performance Python, 2nd Edition
Your Python code may run correctly, but you need it to run faster. Updated for Python …
book
Robust Python
Does it seem like your Python projects are getting bigger and bigger? Are you feeling the …
book
Python Cookbook, 3rd Edition
If you need help writing programs in Python 3, or want to update older Python 2 …
book
Mastering Python - Second Edition
Use advanced features of Python to write high-quality, readable code and packages Key Features Extensively updated …