:chart_with_upwards_trend: Performance analysis for Python snippets
:chart_with_upwards_trend: Performance analysis for Python snippets
For example, to compare different NumPy array concatenation methods, the script
…produces
Clearly, stack and vstack are the best options for large arrays.
(By default, perfplot asserts the equality of the output of all snippets, too.)
If your plot takes a while to generate, you can also use
perfplot.live(
# ...
)with the same arguments as above. It will plot the updates live.
Benchmarking and plotting can be separated. This allows multiple plots of the same data, for example:
out = perfplot.bench(
# same arguments as above (except the plot-related ones, like time_unit or log*)
)
out.show()
out.save("perf.png", transparent=True, bbox_inches="tight")Other examples:
perfplot is available from the Python Package Index, so simply do
pip install perfplotto install.
To run the perfplot unit tests, check out this repository and type
toxThis software is published under the GPLv3 license.
No open issues yet, or sync has not completed.