circuitpython/tests/perf_bench/core_qstr.py
Angus Gratton 5568c324ba tests/perf_bench: Add some configurations for N=32, M=10.
For STM32L072 and similar, very low end targets.

The other perf_bench tests run out of memory, crash, or fail on
prerequisite features.

Signed-off-by: Angus Gratton <gus@projectgus.com>
2022-06-28 10:32:18 +10:00

22 lines
471 B
Python

# This tests qstr_find_strn() speed when the string being searched for is not found.
def test(r):
for _ in r:
str("a string that shouldn't be interned")
###########################################################################
# Benchmark interface
bm_params = {
(32, 10): (400,),
(1000, 10): (4000,),
(5000, 10): (40000,),
}
def bm_setup(params):
(nloop,) = params
return lambda: test(range(nloop)), lambda: (nloop // 100, None)