Benchmark Python Snippets Online

Perfpy allows you to benchmark python snippets online and share them with other people. You can measure the performance and memory usage of code on different python versions in this sandbox environment.

The tool can compare and test the speed of 3rd-party libraries or library versions, so you can find out which is the fastest or consumes less memory between numpy, opencv, scipy and pandas for a certain function.

Packages

Setup

Runs before the benchmark, and it is not measured. Good place to import libraries and prepare data. Learn more

Code 1

Code 2

Code 3

Teardown

Runs after the benchmark, and it is not measured. Good place to print out results. Learn more

Results

Fastest

function

521 ms

1.92 op/s

Speed

BenchmarkRuntime
Operations
VS
Visual
function521 ms1.92 op/s0.5213772505521774
next524 ms1.91 op/s0.5239304304122925
lambda1.55 s0.647 op/s1.545538729056716

Memory

BenchmarkPeak Memory
Score
VS
Visual
lambda< 1 KB7.810
next< 1 KB8.280
function< 1 KB8.280

Output

function
None
next
None
lambda
None