Python High Performance Programming

If you have at least a basic knowledge of Python, this book will help you maximize the performance of your code and applications. Easy to follow tutorials will make you a hard act to follow in Python programming.
Preview in Mapt

Python High Performance Programming

Gabriele Lanaro

2 customer reviews
If you have at least a basic knowledge of Python, this book will help you maximize the performance of your code and applications. Easy to follow tutorials will make you a hard act to follow in Python programming.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$12.60
RRP $17.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$12.60
$29.99
$29.99p/m after trial
RRP $17.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Python High Performance Programming Book Cover
Python High Performance Programming
$ 17.99
$ 12.60
Python High Performance - Second Edition Book Cover
Python High Performance - Second Edition
$ 31.99
$ 22.40
Buy 2 for $30.10
Save $19.88
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781783288458
Paperback108 pages

Book Description

Python is a programming language with a vibrant community known for its simplicity, code readability, and expressiveness. The massive selection of third party libraries make it suitable for a wide range of applications. This also allows programmers to express concepts in fewer lines of code than would be possible in similar languages. The availability of high quality numerically-focused tools has made Python an excellent choice for high performance computing. The speed of applications comes down to how well the code is written. Poorly written code means poorly performing applications, which means unsatisfied customers.

This book is an example-oriented guide to the techniques used to dramatically improve the performance of your Python programs. It will teach optimization techniques by using pure python tricks, high performance libraries, and the python-C integration. The book will also include a section on how to write and run parallel code.

This book will teach you how to take any program and make it run much faster. You will learn state-of the art techniques by applying them to practical examples. This book will also guide you through different profiling tools which will help you identify performance issues in your program. You will learn how to speed up your numerical code using NumPy and Cython. The book will also introduce you to parallel programming so you can take advantage of modern multi-core processors.

This is the perfect guide to help you achieve the best possible performance in your Python applications.

Table of Contents

Chapter 1: Benchmarking and Profiling
Designing your application
Writing tests and benchmarks
Finding bottlenecks with cProfile
Profile line by line with line_profiler
Optimizing our code
The dis module
Profiling memory usage with memory_profiler
Performance tuning tips for pure Python code
Summary
Chapter 2: Fast Array Operations with NumPy
Getting started with NumPy
Rewriting the particle simulator in NumPy
Reaching optimal performance with numexpr
Summary
Chapter 3: C Performance with Cython
Compiling Cython extensions
Adding static types
Sharing declarations
Working with arrays
Particle simulator in Cython
Profiling Cython
Summary
Chapter 4: Parallel Processing
Introduction to parallel programming
The multiprocessing module
IPython parallel
Parallel Cython with OpenMP
Summary

What You Will Learn

  • Assess the performance of your programs using benchmarks
  • Spot the bottlenecks in your code using the Python profiling tools
  • Speed up your code by replacing Python loops with NumPy
  • Boost NumPy performance using the numexpr compiler
  • Use Cython to reach performance on par with the C language
  • Write code for multiple processors
  • Profile, optimize, and rewrite an application from start to finish

Authors

Table of Contents

Chapter 1: Benchmarking and Profiling
Designing your application
Writing tests and benchmarks
Finding bottlenecks with cProfile
Profile line by line with line_profiler
Optimizing our code
The dis module
Profiling memory usage with memory_profiler
Performance tuning tips for pure Python code
Summary
Chapter 2: Fast Array Operations with NumPy
Getting started with NumPy
Rewriting the particle simulator in NumPy
Reaching optimal performance with numexpr
Summary
Chapter 3: C Performance with Cython
Compiling Cython extensions
Adding static types
Sharing declarations
Working with arrays
Particle simulator in Cython
Profiling Cython
Summary
Chapter 4: Parallel Processing
Introduction to parallel programming
The multiprocessing module
IPython parallel
Parallel Cython with OpenMP
Summary

Book Details

ISBN 139781783288458
Paperback108 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Python 3 Object Oriented Programming Book Cover
Python 3 Object Oriented Programming
$ 29.99
$ 21.00
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Building Machine Learning Systems with Python Book Cover
Building Machine Learning Systems with Python
$ 29.99
$ 6.00
Python Data Analysis Book Cover
Python Data Analysis
$ 29.99
$ 21.00
Expert Python Programming Book Cover
Expert Python Programming
$ 26.99
$ 5.40
Azure for Architects Book Cover
Azure for Architects
$ 35.99
$ 25.20