Skip to content

Lightning-AI/litperf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LitPerf

Lightweight performance tracker for Python code - zero overhead when disabled.

install

pip install git+https://github.com/Lightning-AI/litperf.git

Example use

from litperf import PerfTimer

timer = PerfTimer()
    
# Step 1
numbers = [i * i for i in range(50000)]
timer.mark("step1: count")

# Step 2
total = 0
for num in numbers:
    total += num / 2

timer.mark("step2: sum_numbers")

timer.print_report()

The above generates the following report:

==============================
Timing Report: 

start → step1: count: 0.0031 seconds
step1: count → step2: sum_numbers: 0.0036 seconds
------------------------------
Total time: 0.0067 seconds
------------------------------

About

Lightweight performance tracker for Python code - zero overhead when disabled.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages