Files
micropython/tests/internal_bench/class_instance-4.1-slots5.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
147 B
Python

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