Files
micropython/tests/internal_bench/class_instance-4-slots.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

14 lines
127 B
Python

import bench
class X:
__slots__ = ["x"]
def test(num):
for i in range(num // 5):
x = X()
bench.run(test)