TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python: New patch may give speedups of up to 20%

28 点作者 ks超过 16 年前

3 条评论

lunchbox超过 16 年前
Although this is a potentially exciting development, I dislike when people use phrases like "speedups of <i>up to</i> 20%." Quoting only the best-case scenario is misleading, since it says little about the average case. What if that 20% speedup only occurs 2% of the time, and the other 98% of the time, you have a &#60;2% improvement? I understand that people want to promote and be recognized for their work by referencing the best cases, but it would be more helpful if they quoted typical results, like the range of speedups achieved on the benchmarks.
评论 #449657 未加载
评论 #450355 未加载
jd超过 16 年前
When you look at the bottlenecks in opcode throughput for virtual machines it's almost always lousy branch prediction. Using a branch table instead of a switch block is not going to make much of a difference in any realistic program. The CPU has no idea which function is going to get called next so it can never fully use all the advanced look-ahead mechanisms.<p>For those interested, look at all the performance improvements made in the ocaml and perl and clisp interpreters. There is a lot of low hanging performance fruit left in the Python interpreter - the question is whether it's worth plucking. For instance, python can get a dedicated accumulator (I don't think it has one now) and you can introduce new opcodes that combine functionality of frequently occurring opcode sequences. For instance, python now has a LOAD_CONST and BINARY_ADD instruction, but not LOAD_COST&#38;ADD instruction like clisp.<p>By combining the functionality of two instructions into one you're essentially saving an opcode dispatch. Saving a jump is going to make a bigger difference than making a jump faster. So that's where I think the python guys should focus on if they really want to improve performance.
评论 #450213 未加载
评论 #450128 未加载
评论 #450116 未加载
adamsmith超过 16 年前
This surprises me because it's the second of its kind in the past couple months. (There was another patch that helped CPUs exercise their execution branch prediction capabilities.)<p>I would have guessed that this phase in a language's evolution would come much earlier in the adoption curve. ...like, five years ago for python. Interesting!<p>Here's to further optimizations!
评论 #449625 未加载
评论 #449617 未加载