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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The Bitter Truth: Python 3.11 vs. Cython vs. C++ Performance for Simulations

5 点作者 vardhanw超过 2 年前

2 条评论

auraham超过 2 年前
Side note: Can somebody explain the difference between real, user, and sys? I understand that real is basically the time spent from start to finish (which can be affected by other processes), whereas user and sys consider the amount of time where the CPU was actually busy running a program (not waiting for other things like I&#x2F;O). For example, what is the meaning of user and sys from this example? [1]:<p><pre><code> $ time wget https:&#x2F;&#x2F;download.virtualbox.org&#x2F;virtualbox&#x2F;6.1.28&#x2F;virtualbox-6.1_6.1.28-147628~Ubuntu~eoan_amd64.deb real 0m8.515s user 0m0.125s sys 0m0.487s </code></pre> According to [2], user + sys would be a better measurement than real for comparing Python, Cython, and C++.<p>[1] <a href="https:&#x2F;&#x2F;www.hostinger.com&#x2F;tutorials&#x2F;linux-time-command" rel="nofollow">https:&#x2F;&#x2F;www.hostinger.com&#x2F;tutorials&#x2F;linux-time-command</a><p>[2] <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;10265162&#x2F;the-meaning-of-real-user-and-sys-in-output-of-linux-time-command" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;10265162&#x2F;the-meaning-of-...</a>
评论 #34115156 未加载
Rochus超过 2 年前
That&#x27;s a very interesting article, thanks. Interesting to note that Cython is only about twice as fast as Python 3.10 and only about 40% faster than Python 3.11.<p>The official Python site advertises a speedup of 25% from 3.10 to 3.11; in the article a speedup of 60% was measured. It therefore usually makes sense to measure different algorithms. Unfortunately there is no Python or C++ implementation yet for <a href="https:&#x2F;&#x2F;github.com&#x2F;smarr&#x2F;are-we-fast-yet">https:&#x2F;&#x2F;github.com&#x2F;smarr&#x2F;are-we-fast-yet</a>.