-
- Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
3.12only security fixesonly security fixesperformancePerformance or resource usagePerformance or resource usage
Description
Benchmark:
import pyperf from pyperf import Runner class Descr: def __init__(self, value): self.value = value def __get__(self, instance, owner): return self.value class A: x = Descr(1) def bench(loops): a = A() t1 = pyperf.perf_counter() for _ in range(loops): a.x t2 = pyperf.perf_counter() return t2 - t1 runner = Runner() runner.bench_time_func('descriptor', bench)
Results:
@kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python -m pyperf compare_to base.json patch.json Mean +- std dev: [base] 102 ns +- 6 ns -> [patch] 88.5 ns +- 4.0 ns: 1.15x faster
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixesperformancePerformance or resource usagePerformance or resource usage