Commit efda3095 authored by Stefan Behnel's avatar Stefan Behnel

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

parent a0d67e2f
...@@ -13,10 +13,198 @@ def run(): ...@@ -13,10 +13,198 @@ def run():
f = 1.0 f = 1.0
x = 2 x = 2
n = 5 n = 5
i = 12345678
s = 'abc' s = 'abc'
u = u'üöä' u = u'üöä'
for i in range(100): # 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}"
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}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}{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}"
......
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