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.

120ms to 30ms: Python to Rust

37 pointsby 0xedb11 months ago

8 comments

galkk11 months ago
Almost always when I start prototyping something in python, I wish that I stopped half-way where I am now and switched to something else.<p>Most recent example - converting huge amount of xml files to parquet. I started very fast with python + pyarrow, but when I realized that parallelizing execution would help enormously, I hit GIL or picking&#x2F;unpickling&#x2F;multiprocessing costs.<p>It did work in python, in the end, but I feel that writing that in Rust&#x2F;C# (even if I don&#x27;t know Rust besides tutorials) in the end would be much more performant.
评论 #40820492 未加载
评论 #40816687 未加载
评论 #40816555 未加载
评论 #40816908 未加载
评论 #40816880 未加载
评论 #40829809 未加载
评论 #40828432 未加载
评论 #40819430 未加载
评论 #40818271 未加载
bin_bash11 months ago
I enjoy both languages quite a bit, but a 4x improvement is more of a testament to python than it is to rust imo!
评论 #40818218 未加载
gumby11 months ago
What I get from this is that the python interpreter is better than I would have guessed.
评论 #40815906 未加载
评论 #40818381 未加载
Talinx11 months ago
That is a lot of text for not determining why the new solution is faster. The only relevant part:<p>&gt; Before our migration, the old pipeline utilized a C library accessed through a Python service, which buffered and bundled data. This was really the critical aspect that was causing our latency.<p>How much speed up would there have been if they moved to a Rust wrapper around the same C library?<p>Using something other than Python is almost always going to be faster. This Reddit post does not give any insights into which aspects of Python lead to small&#x2F;large performance hits. They show that it was the right solution for them with ample documentation which is great, but they don&#x27;t provide any generalizable information.
Havoc11 months ago
Noticed similar scale of improvement when testing the two on cloud functions.<p>Just comes down to whether you need speed of building it or speed of program
pjmlp11 months ago
Could be renamed as <i>120ms to 30ms: Python to &quot;AOT compiled language&quot;</i>.
gregors11 months ago
Am I the only one thinking &quot;why wasn&#x27;t it better?&quot;<p>Guess I&#x27;m never satisfied
jti10711 months ago
use the right tool for the right job. your software requirements and design document should drive the language and the tools you use.
评论 #40817165 未加载