Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

perfplot

> 数据库
Open source

:chart_with_upwards_trend: Performance analysis for Python snippets

1.4K stars0 likes2 views
WebsiteGitHub

About

:chart_with_upwards_trend: Performance analysis for Python snippets

perfplot extends Python's [timeit](https://docs.python.org/3/library/timeit.html) by testing snippets with input parameters (e.g., the size of an array) and plotting the results.

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

python
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:

python
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:

  • Making a flat list out of list of lists in Python
  • Most efficient way to map function over numpy array
  • numpy: most efficient frequency counts for unique values in an array
  • Most efficient way to reverse a numpy array
  • How to add an extra column to an numpy array
  • Initializing numpy matrix to something other than zero or one

Installation

perfplot is available from the Python Package Index, so simply do

bash
pip install perfplot

to install.

Testing

To run the perfplot unit tests, check out this repository and type

tox

License

This software is published under the GPLv3 license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonperformance-analysispython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库