Commit efda3095 authored by Stefan Behnel's avatar Stefan Behnel

avoid Cython's for-loop speed advantage in fstrings benchmark

parent a0d67e2f
......@@ -13,25 +13,213 @@ def run():
f = 1.0
x = 2
n = 5
i = 12345678
s = 'abc'
u = u'üöä'
for i in range(100):
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:3.2}--{n:2}{n:5}oo{i}{s}"
f"{n}oo{n*10}{f:5.2}--{n:2}{n:5}oo{i}{u}"
f"{n}oo{n*10}{f:2.2}--{n:2}{n:5}oo{i}{s}xx{u}"
# repeat without fast looping ...
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:3.2}--{n:2}{n:5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x{u}"
# repeat without fast looping ...
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:3.2}--{n:2}{n:5}oo{i}{s}"
f"{n}oo{n*10}{f:5.2}--{n:2}{n:5}oo{i}{u}"
f"{n}oo{n*10}{f:2.2}--{n:2}{n:5}oo{i}{s}xx{u}"
# repeat without fast looping ...
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:3.2}--{n:2}{n:5}oo{i}{s}"
f"{n}oo{n*10}{f:5.2}--{n:2}{n:5}oo{i}{u}"
f"{n}oo{n*10}{f:2.2}--{n:2}{n:5}oo{i}{s}xx{u}"
# repeat without fast looping ...
f"{n}oo{n*10}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o{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:.2}--{n:2}{n:5}oo{i}"
f"{n}oo{n*10}{f:3.2}--{n:2}{n:5}oo{i}{s}"
f"{n}oo{n*10}{f:5.2}--{n:2}{n:5}oo{i}{u}"
f"{n}oo{n*10}{f:2.2}--{n:2}{n:5}oo{i}{s}xx{u}"
tk = time()
return tk - t0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment