2022-02-09 22:53:29 -05:00
|
|
|
# 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 = {
|
2022-06-07 03:46:08 -04:00
|
|
|
(32, 10): (400,),
|
2022-02-09 22:53:29 -05:00
|
|
|
(1000, 10): (4000,),
|
|
|
|
(5000, 10): (40000,),
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def bm_setup(params):
|
|
|
|
(nloop,) = params
|
|
|
|
return lambda: test(range(nloop)), lambda: (nloop // 100, None)
|