Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Python High Performance
  • Table Of Contents Toc
Mastering Python High Performance

Mastering Python High Performance

By : Fernando Donglio
4.2 (5)
close
close
Mastering Python High Performance

Mastering Python High Performance

4.2 (5)
By: Fernando Donglio

Overview of this book

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.
Table of Contents (10 chapters)
close
close

The problem to solve


Before we even start thinking about writing the initial version of our code, we need to understand the problem we're trying to solve.

Given the scope of the book, a full-blown application might be too big an undertaking, so we'll focus on a small task. It'll give us better control over what we want to do, and we won't run the risk of having too many things to optimize at the same time.

To keep things interesting, we'll split the problem into the following two parts:

  • Part 1: This will take care of finding the data we want to process. It won't just be a dataset we download from some given URL. Instead, we'll scrape it from the Web.

  • Part 2: This will focus on processing the data obtained after solving the first part of the problem. In this step, we may perform the most CPU-intensive computations and calculate some statistics from the data gathered.

In both cases, we'll create an initial version of the code that solves the problem without taking performance into account. Afterwards...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Python High Performance
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon