Have a personal or library account? Click to login
Mastering Python High Performance Cover

Mastering Python High Performance

Learn how to optimize your code and Python performance with this vital guide to Python performance profiling and benchmarking

Paid access
|Sep 2025
Product purchase options

Key Features

    Book Description

    Simply knowing how to code is not enough; on mission-critical pieces of code, every bit of memory and every CPU cycle counts, and knowing how to squish every bit of processing power out of your code is a crucial and sought-after skill. Nowadays, Python is used for many scientific projects, and sometimes the calculations done in those projects require some serious fine-tuning. Profilers are tools designed to help you measure the performance of your code and help you during the optimization process, so knowing how to use them and read their output is very handy.
    This book starts from the basics and progressively moves on to more advanced topics. You’ll learn everything from profiling all the way up to writing a real-life application and applying a full set of tools designed to improve it in different ways. In the middle, you’ll stop to learn about the major profilers used in Python and about some graphic tools to help you make sense of their output. You’ll then move from generic optimization techniques onto Python-specific ones, going over the main constructs of the language that will help you improve your speed without much of a change. Finally, the book covers some number-crunching-specific libraries and how to use them properly to get the best speed out of them.
    After reading this book, you will know how to take any Python code, profile it, find out where the bottlenecks are, and apply different techniques to remove them.

    What you will learn

    • Master code optimization stepbystep and learn how to use different tools
    • Understand what a profiler is and how to read its output
    • Interpret visual output from profiling tools and improve the performance of your script
    • Use Cython to create fast applications using Python and C
    • Take advantage of PyPy to improve performance of Python code
    • Optimize numbercrunching code with NumPy, Numba, Parakeet, and Pandas

    Who this book is for

    Table of Contents

    1. Profiling 101
    2. The Profilers
    3. Going visual ? GUIs to help understand profiler output
    4. Optimize all the things
    5. MultiThreading vs MultiProcessing
    6. Generic optimization options
    7. Lightning fast number crunching with Numba, Parakeet and Pandas
    8. Putting it all into practice
    PDF ISBN: 978-1-78398-931-7
    Publisher: Packt Publishing Limited
    Copyright owner: © 2015 Packt Publishing Limited
    Publication date: 2025
    Language: English
    Pages: 260