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
  • Feedback & Rating feedback
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

Parakeet


This one is the most specific tool yet to deal with numbers in Python. It is very specific because it only supports a very narrow subset of the resulting combination of Python and NumPy. So, if you're dealing with anything outside that universe, this might not be an option for you, but if you can fit your solution into it, then keep on reading.

To be more specific about the limited universe that Parakeet supports (normally useful only to express numerical computations), here is a short list:

  • Types supported by Python are numbers, tuples, slices, and NumPy's arrays

  • Parakeet follows the upcasting rule, that is, whenever two values of different types try to reach the same variable, they'll be upcast into a unifying one. For instance, the Python expression 1.0 if b else false would translate to 1.0 if b else 0.0, but when automatic casting isn't possible, such as 1.0 if b else (1,2), then an uncatchable exception (see next point) will be raised during compilation time.

  • Catching or even...

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