Files
micropython/tests/internal_bench/class_instance-1.3-empty-gc.py
Anson Mansfield 6d09d3e76e tests/internal_bench/class_instance: Benchmark instantiation.
This commit adds tests to benchmark the performance of class instantiation.

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-09-15 16:09:55 +10:00

16 lines
141 B
Python

import bench
import gc
class X:
pass
def test(num):
for i in range(num // 5):
x = X()
gc.collect()
bench.run(test)