A lightweight decorator to measure function execution time and peak memory.
Project description
PerfLens 🚀
PerfLens (性能放大镜) 是一个极简的 Python 库。它提供了一个优雅的装饰器,帮助你瞬间洞察函数的执行耗时和内存峰值占用。
为什么选择 PerfLens?
零依赖:只使用 Python 标准库,不污染你的环境。
极简 API:只需一行 @measure。
直观输出:直接在终端打印美观的性能报告。
快速开始
将 perflens.py 放入你的项目中,然后像这样使用:
from perflens import measure
@measure def process_data(): # 模拟一个吃内存和耗时的操作 data = [x**2 for x in range(1000000)] return sum(data)
process_data()
输出示例:
🚀 [PerfLens] 函数 'process_data' 执行完毕: ⏱️ 耗时: 0.1234 秒 💾 峰值内存: 38.5123 MB
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file perflens_wz-0.1.0.tar.gz.
File metadata
- Download URL: perflens_wz-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda5ae08625b9efd6fbfb2469ce8e7b4c34d9d1d48e21c17117f9b4fcb6000dc
|
|
| MD5 |
ffef7711491b82dd6d46f0d41e98608a
|
|
| BLAKE2b-256 |
509d04e498e2fd605aeb43b6746cd7b4a82276eeebf020422eb06090416524eb
|
File details
Details for the file perflens_wz-0.1.0-py3-none-any.whl.
File metadata
- Download URL: perflens_wz-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
763c41dcd2c604826e127115f6aa950137a576c6dd8a4445eb05abce91c585f6
|
|
| MD5 |
9333c22a893ac550dc75aa7e835a53ba
|
|
| BLAKE2b-256 |
fe54def852b79e2a72006d097097633bdcbab082f90d787275bd046a48865493
|