High performance python : practical performant programming for humans /
Your Python code may run correctly, but you need it to run faster. Updated for Python 3, this expanded edition shows you how to locate performance bottlenecks and significantly speed up your code in high-data-volume programs. By exploring the fundamental theory behind design choices, High Performanc...
Clasificación: | Libro Electrónico |
---|---|
Autores principales: | , |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Beijing ; Boston :
O'Reilly,
2020.
|
Edición: | Second edition. |
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Intro
- Copyright
- Table of Contents
- Foreword
- Preface
- Who This Book Is For
- Who This Book Is Not For
- What You'll Learn
- Python 3
- Changes from Python 2.7
- License
- How to Make an Attribution
- Errata and Feedback
- Conventions Used in This Book
- Using Code Examples
- O'Reilly Online Learning
- How to Contact Us
- Acknowledgments
- Chapter 1. Understanding Performant Python
- The Fundamental Computer System
- Computing Units
- Memory Units
- Communications Layers
- Putting the Fundamental Elements Together
- Idealized Computing Versus the Python Virtual Machine
- So Why Use Python?
- How to Be a Highly Performant Programmer
- Good Working Practices
- Some Thoughts on Good Notebook Practice
- Getting the Joy Back into Your Work
- Chapter 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
- Introspecting an Existing Process with PySpy
- Bytecode: Under the Hood
- Using the dis Module to Examine CPython Bytecode
- Different Approaches, Different Complexity
- Unit Testing During Optimization to Maintain Correctness
- No-op @profile Decorator
- Strategies to Profile Your Code Successfully
- Wrap-Up
- Chapter 3. Lists and Tuples
- A More Efficient Search
- Lists Versus Tuples
- Lists as Dynamic Arrays
- Tuples as Static Arrays
- Wrap-Up
- Chapter 4. Dictionaries and Sets
- How Do Dictionaries and Sets Work?
- Inserting and Retrieving
- Deletion
- Resizing
- Hash Functions and Entropy
- Dictionaries and Namespaces
- Wrap-Up
- Chapter 5. Iterators and Generators
- Iterators for Infinite Series
- Lazy Generator Evaluation
- Wrap-Up
- Chapter 6. Matrix and Vector Computation
- Introduction to the Problem
- Aren't Python Lists Good Enough?
- Problems with Allocating Too Much
- Memory Fragmentation
- Understanding perf
- Making Decisions with perf's Output
- Enter numpy
- Applying numpy to the Diffusion Problem
- Memory Allocations and In-Place Operations
- Selective Optimizations: Finding What Needs to Be Fixed
- numexpr: Making In-Place Operations Faster and Easier
- A Cautionary Tale: Verify "Optimizations" (scipy)
- Lessons from Matrix Optimizations
- Pandas
- Pandas's Internal Model
- Applying a Function to Many Rows of Data
- Building DataFrames and Series from Partial Results Rather than Concatenating
- There's More Than One (and Possibly a Faster) Way to Do a Job
- Advice for Effective Pandas Development
- Wrap-Up
- Chapter 7. Compiling to C
- What Sort of Speed Gains Are Possible?
- JIT Versus AOT Compilers