Profiling 101 for Python Developers: Using Blackfire 6/6

By Christophe Dujarric, on Feb 12, 2020

Blog post series index:

  1. What is a Profiler?
  2. The Many Types of Profilers
  3. List of Existing Python Profilers
  4. Picking the Right Profiler
  5. Profiles visualizations
  6. Using Blackfire (you are here)

This series of article walked through the various types of profiling technologies, trying to give an overview of what exists, and the pros and cons.

Blackfire is hard at work on finding the best trade-offs for optimal accuracy, with the lowest intrinsic performance consumption. Let’s look back at the key benefits compared to other solutions in the Python world:

  • Easy installation and use, with no instrumentation needed
  • SaaS, enabling to benefit instantaneously from any web UI and features improvements
  • No overhead for end users
  • Complementary (appealing) call-graph and timeline visualizations
  • Built for collaboration and seamless profiling information sharing within teams

At the time of writing, Blackfire for Python is in Beta. Expect this list to increase in the coming weeks and month, as we aim at offering Python developers the same service than we do for PHP developers. Check our docs to discover our many features and ways to inspect your code for performance, security and quality improvements!

Time is just a consequence

As a last word in this series, it is key to understand this core principle in profiling. Time is just a consequence of what happened in the code.

It is not a stable metric, as it can be influenced by many factors, such as the server load.

A time value, on its own, isn’t actionable.

How to determine whether it’s actually “good” or “bad”? As opposed to what?

Also, the amount of data handled by the code can also have significant impact. Profiles generated on a local machine with test data may show nice time results, and much slower ones when in production with real data.

Profile. Understand the code’s behavior. Compare. This is the process to optimization.

Happy profiling,

Christophe Dujarric

Christophe is the Chief Product Officer at Blackfire. He's an engineer, but probably one of the least "tech" people in the company. He's wearing many hats, from product management to marketing and sales. He loves the beauty of simple solutions that solve actual problems.