Jason Brownlee's Blog, page 15
September 21, 2023
Benchmark Python with time.monotonic()
You can benchmark Python code using the time.monotonic() function. In this tutorial, you will discover how to benchmark Python code using the time.monotonic() function. Let’s get started. Need to Benchmark Python Code Benchmarking Python code refers to comparing the performance of one program to variations of the program. Benchmarking is the practice of comparing business […]
Published on September 21, 2023 12:00
September 19, 2023
Benchmark Python with time.perf_counter()
You can benchmark Python code using the time.perf_counter() function. In this tutorial, you will discover how to benchmark Python code using the time.perf_counter() function. Let’s get started. Need to Benchmark Python Code Benchmarking Python code refers to comparing the performance of one program to variations of the program. Benchmarking is the practice of comparing business […]
Published on September 19, 2023 12:00
September 17, 2023
Benchmark Python with time.time()
You can benchmark Python code using the time.time() function. In this tutorial, you will discover how to benchmark Python code using the time.time() function. Let’s get started. Need to Benchmark Python Code Benchmarking Python code refers to comparing the performance of one program to variations of the program. Benchmarking is the practice of comparing business […]
Published on September 17, 2023 12:00
September 14, 2023
Stopwatch Timer Class For Benchmarking
You can develop a stopwatch timer class to benchmark the execution time of Python code. In this tutorial, you will discover how to develop a stopwatch timer class for benchmarking in Python. Let’s get started. Need a Stopwatch Timer Class for Benchmarking Benchmarking Python code refers to comparing the performance of one program to variations […]
Published on September 14, 2023 12:00
September 12, 2023
Benchmark Decorator in Python
You can develop a custom benchmark decorator that will automatically record and report the execution time of target functions. This requires defining the decorator function and adding the decoration to the function to be benchmarked. In this tutorial, you will discover how to automatically benchmark target functions using a benchmark decorator in Python. Let’s get […]
Published on September 12, 2023 12:00
September 10, 2023
Benchmark Helper Function in Python
You can develop a helper function to benchmark target functions in Python. In this tutorial, you will discover how to develop and use a benchmark helper function to benchmark functions in Python. Let’s get started. Benchmark Python Code With time.time() We can benchmark Python code using the time module. The time.time() function will return the […]
Published on September 10, 2023 12:00
September 7, 2023
Benchmark Context Manager in Python
You can develop a custom context manager to automatically benchmark code in Python. In this tutorial, you will discover how to benchmark Python code using a context manager. Let’s get started. Benchmark Python Code With time.time() We can benchmark Python code using the time module. The time.time() function will return the current time in seconds […]
Published on September 07, 2023 12:00
September 5, 2023
Python Benchmark Comparison Metrics
You can calculate Python benchmark metrics like the difference and the speedup in order to compare the performance improvements of concurrent versions of a program to the sequential version. In this tutorial, you will discover how to calculate metrics to compare the benchmark performance of sequential versus concurrent programs in Python. Let’s get started. Compare […]
Published on September 05, 2023 12:00
September 3, 2023
4 Ways to Benchmark Python Code
You can benchmark Python code using the Python standard library. Code can be benchmarked manually using the time module. The timeit module provides functions for automatically benchmarking code. The cPorfile and profile modules can be used for benchmarking, although are not well-suited. On a Linux or macOS workstation, we can use the time command to […]
Published on September 03, 2023 12:00
August 31, 2023
Fastest Way To Share NumPy Array Between Processes
You can share a NumPy array between processes in Python using a suite of different techniques. Generally, if the shared array can be read-only, then the fastest method to share the array between processes is via inheritance. If multiple processes need to read and write the shared NumPy array then a memory-mapped file or shared […]
Published on August 31, 2023 12:00


