Book description
Your Python code may run correctly, but you need it to run faster. By exploring the fundamental theory behind design choices, this practical guide helps you gain a deeper understanding of Python’s implementation. You’ll learn how to locate performance bottlenecks and significantly speed up your code in high-data-volume programs.
How can you take advantage of multi-core architectures or clusters? Or build a system that can scale up and down without losing reliability? Experienced Python programmers will learn concrete solutions to these and other issues, along with war stories from companies that use high performance Python for social media analytics, productionized machine learning, and other situations.
- 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
- Use tools to compile Python down to machine code
- Manage multiple I/O and computational operations concurrently
- Convert multiprocessing code to run on a local or remote cluster
- Solve large problems while using less RAM
Publisher resources
Table of contents
- Preface
- 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
- Using runsnakerun to Visualize cProfile Output
- Using line_profiler for Line-by-Line Measurements
- Using memory_profiler to Diagnose Memory Usage
- Inspecting Objects on the Heap with heapy
- Using dowser for Live Graphing of Instantiated Variables
- Using the dis Module to Examine CPython Bytecode
- 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
- 6. Matrix and Vector Computation
- 7. Compiling to C
- 8. Concurrency
- 9. The multiprocessing Module
- 10. Clusters and Job Queues
- 11. Using Less RAM
- 12. Lessons from the Field
- Index
- Colophon
- Copyright
Product information
- Title: High Performance Python
- Author(s):
- Release date: September 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449361594
You might also like
book
Python Cookbook
The Python Cookbook is a collection of problems, solutions, and practical examples for Python programmers, written …
book
High Performance Python, 2nd Edition
Your Python code may run correctly, but you need it to run faster. Updated for Python …
book
Effective Python: 59 Specific Ways to Write Better Python
It’s easy to start coding with Python, which is why the language is so popular. However, …
book
Python One-Liners
Python One-Liners will teach you how to read and write “one-liners”: concise statements of useful functionality …