Python 官方文档( https://docs.python.org/3.14/whatsnew/3.14.html#a-new-type-of-interpreter) :
A new type of interpreter based on tail calls has been added to CPython. For certain newer compilers, this interpreter provides significantly better performance. Preliminary numbers on our machines suggest anywhere from -3% to 30% faster Python code, and a geometric mean of 9-15% faster on
pyperformance
depending on platform and architecture. The baseline is Python 3.14 built with Clang 19 without this new interpreter.
其实我很想知道,这种性能测试的结果到底准不准?熟悉这方面的大佬来聊聊。
1
vkillwucy 7 天前 via Android ![]() 盲猜一个不准
|
2
crackidz 7 天前 ![]() https://github.com/faster-cpython/benchmarking-public 可以看下他们跑的基准测试都跑了哪些场景
|
3
xgdgsc 7 天前 via Android ![]() 准肯定是准的,就是真需要这个性能的早都转 Julia rust cpp 了
|
4
alwaysol 6 天前 ![]() 提高-3%?
|
5
strobber16 6 天前 via Android ![]() go 1.24 使用新型 runtime ,速度提高 2%~3%
|
6
coolcoffee 6 天前 ![]() 我怎么感觉是 python 之前的性能实在是太差,所以显得进步空间贼大。
就以 100 为单位,提升 5%-30%也就是 105 ~ 130 。但是 C++可能在 1000 。 |
![]() |
7
GeekGao 6 天前 ![]() @coolcoffee 没法相比其他语言,只能对比自己。
|
![]() |
8
yh7gdiaYW 6 天前 ![]() 3.11 的时候也说有提升,给出的性能测试结果也不错,结果落到我们的业务场景(主要是大量数据的遍历和计算,有一些环节没法拆到 C++)中速度还变慢了...
|
10
uni 6 天前 ![]() 我挺喜欢 python 的,但是 py 连 nodejs 的性能都比不过。。。
|
11
ninjashixuan 6 天前 ![]() fastpython 项目多少年了,这提升龟速翻五倍的目标是不是遥遥无期了。
|
12
ninjashixuan 6 天前 ![]() @uni 什么叫连,人 v8 引擎一直是高性能的标杆吧。
|
13
tsanie 6 天前 ![]() |
15
Jinnrry 6 天前 ![]() 都用 python 了,还在乎性能吗?真需要性能,拿 c 、rust 写底层,python 调用不就行了?胶水语言就应该干胶水语言干的活
|
![]() |
17
Shatyuka 6 天前 ![]() 太厉害了 python ,很难说是不是之前太慢显得提升很多。
附 3.11 的更新日志: https://docs.python.org/3.11/whatsnew/3.11.html#faster-cpython CPython 3.11 is an average of 25% faster than CPython 3.10 as measured with the pyperformance benchmark suite, when compiled with GCC on Ubuntu Linux. Depending on your workload, the overall speedup could be 10-60%. |
![]() |
18
lesismal 6 天前 ![]() 300%也还是慢...
|
19
jjx 6 天前 ![]() 因为从 2 到 3 , 就慢了
现在只是恢复到 2 的水准,哈哈 |
![]() |
21
ChrisFreeMan 6 天前 ![]() @lesismal 不如 3500 倍快的 python 杀手 Mojo Lang🐶
|
23
Binwalker 6 天前 ![]() 都用 python 了,还想效率,就算提升 100%也没什么用
|
24
wionch 6 天前 ![]() GIL 锁还在没?
|
![]() |
25
iorilu 6 天前 ![]() python 根本不在乎性能
需要性能, 用 rust 可能就提升几十上百倍了 |
![]() |
26
vsheyan 6 天前 ![]() 库是真的多用就完了
|
![]() |
27
zhouquanbest 6 天前 ![]() 卖家秀
你往前看看过去版本的性能优化 Log ,吹的也不小 |
28
CodeCodeStudy 5 天前 ![]() @JokerSH #9 按 F12 看了网页源码,确定是-3%而不是连字符
|
![]() |
29
llsquaer 5 天前
python3.10 路过。。才升为主力开发版本
|
30
JokerSH 5 天前 ![]() @CodeCodeStudy 感谢指正。
|
![]() |
31
dragondove 5 天前 ![]() @wionch 现阶段的 nogil 只能帮助提升多线程的性能,单线程的性能反而会下降,你可以自己构建 python 3.13 ,构建参数有 gil 相关的,现在已经可以关闭了。
|
33
uni 5 天前
@ninjashixuan #12 因为同为脚本语言,定位相似
|