Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perflens_wz-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perflens_wz-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for perflens_wz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cda5ae08625b9efd6fbfb2469ce8e7b4c34d9d1d48e21c17117f9b4fcb6000dc
MD5 ffef7711491b82dd6d46f0d41e98608a
BLAKE2b-256 509d04e498e2fd605aeb43b6746cd7b4a82276eeebf020422eb06090416524eb

See more details on using hashes here.

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

Hashes for perflens_wz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 763c41dcd2c604826e127115f6aa950137a576c6dd8a4445eb05abce91c585f6
MD5 9333c22a893ac550dc75aa7e835a53ba
BLAKE2b-256 fe54def852b79e2a72006d097097633bdcbab082f90d787275bd046a48865493

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page