|
|
|
|
|
by bgwalter
242 days ago
|
|
You can modify the posted script to eliminate global variables: def f():
l = [0]
for i in range(100000000):
l += [2]
return l
x = f()
print(x[0])
Timings: 3.9: 8.6s
3.14: 8.7s
3.14 (free-threading): 11.6s
3.14 is not faster than 3.9 and the free-threading build is 33% slower. |
|
3.9: 2.78
3.14: 3.86
3.14t: 3.91
This is a silly benchmark though. Look at pyperformance if you want something that might represent real script/application performance. Generally 3.14t is about 0.9x the performance of the default build. That depends on a lot of things though.