TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

5 pointsby vardhanwover 2 years ago

2 comments

aurahamover 2 years ago
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 未加载
Rochusover 2 years ago
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>.