Jason Brownlee's Blog, page 11
November 15, 2023
Benchmark Python With benchmarkit
You can use the benchmarkit library to keep track of the performance of functions over time. In this tutorial, you will discover how to use the benchmarkit library to keep track of the performance of Python functions. Let’s get started. What is benchmarkit The project benchmarkit is a Python library for benchmarking. It was developed […]
The post Benchmark Python With benchmarkit appeared first on Super Fast Python.
November 14, 2023
How to Profile Asyncio With line_profiler
You can profile target functions and coroutines in asyncio programs using the line_profiler module. The line_profiler module is a third-party library that gathers profile statistics and generates a report of target functions, highlighting how long each line of the function is spent executing. In this tutorial, you will discover how to use the line_profiler module […]
The post How to Profile Asyncio With line_profiler appeared first on Super Fast Python.
November 13, 2023
Benchmark Python with simple_benchmark
You can use the simple_benchmark library to benchmark and compare the execution time of two or more functions and how their behavior changes with changes to their input. In this tutorial, you will discover how to use the simple_benchmark library for benchmarking in Python. Let’s get started. What is simple_benchmark The project simple_benchmark is a […]
The post Benchmark Python with simple_benchmark appeared first on Super Fast Python.
November 12, 2023
How to Profile Asyncio Programs
You can profile slow asyncio programs to discover coroutines that occupy most of the runtime and functions that are called more than any other. The profilers built into the Python standard library are helpful to quickly discovering why some asyncio programs are slow and where to focus program optimization efforts. In this tutorial, you will […]
The post How to Profile Asyncio Programs appeared first on Super Fast Python.
November 11, 2023
Benchmark Fastest Way To Sort NumPy Arrays
You can benchmark functions and algorithms to sort NumPy arrays to discover the fastest approaches to use. Generally, it is slightly faster to sort a NumPy array in place rather than to create a sorted copy. This approach should be preferred if the program requirements can support it. The choice of sorting algorithm used by […]
The post Benchmark Fastest Way To Sort NumPy Arrays appeared first on Super Fast Python.
November 10, 2023
Benchmark Fastest Way To Create NumPy Random Numbers
You can benchmark NumPy random number array functions and discover the fastest approaches to use in different circumstances. Generally the modern numpy.random.Generator NumPy random number generator should be used over the legacy numpy.random.RandomState random number generator as it is significantly faster. When generating random floats, using a type of float32 is faster than float64. When […]
The post Benchmark Fastest Way To Create NumPy Random Numbers appeared first on Super Fast Python.
November 9, 2023
Asyncio Benchmark Context Manager
You can develop a custom asynchronous context manager to automatically benchmark asyncio code in Python. An asynchronous context manager is a context manager that can be suspended in asyncio when it is entered and exited. We can wrap code that we wish to automatically benchmark using a custom asynchronous context manager. In this tutorial, you […]
The post Asyncio Benchmark Context Manager appeared first on Super Fast Python.
November 8, 2023
Python Benchmarking 7-Day Course
Python code can be slow. We can benchmark Python code discover exactly how slow it is, and then test changes to the code to confirm that the changes we made had the desired effect. This course provides you with a 7-day crash course in Python Benchmarking. You will get a taste of what is possible […]
The post Python Benchmarking 7-Day Course appeared first on Super Fast Python.
November 7, 2023
Asyncio Benchmark Decorator
You can develop a custom benchmark decorator that will automatically record and report the execution time of target coroutines in asyncio programs. This requires defining the decorator and adding the decoration to the coroutine to be benchmarked. In this tutorial, you will discover how to automatically benchmark target coroutines using a benchmark decorator in Python. […]
The post Asyncio Benchmark Decorator appeared first on Super Fast Python.
November 6, 2023
Python Benchmarking With pyperf
You can use the pyperf library to benchmark, analyze, and compare the performance of snippets of Python code. It extends the timeit module’s capabilities and includes the ability to execute benchmarks concurrently and to gather and report summary statistics. In this tutorial, you will discover how to benchmark Python code using the pyperf open source […]
The post Python Benchmarking With pyperf appeared first on Super Fast Python.


