Hacker News new | ask | show | jobs
by Pop_- 932 days ago
Disclaimer: The title has been changed to "Rust std fs slower than Python!? No, it's hardware!" to avoid clickbait. However I'm not able to fix the title in HN.
3 comments

"Works on contingency? No, money down!"
you can mail hn@ycombinator.com and they can change it for you to whatever.
What's the TLDR on how... hardware performs differently on two software runtimes?
AMD's implementation of `rep movsb` instruction is surprisingly slow when addresses are page aligned. Python's allocator happens to add a 16-byte offset that avoids the hardware quirk/bug.
thank you, upvoted!
One of the very first things in the article is a TLDR section that points you to the conclusion.

> In conclusion, the issue isn't software-related. Python outperforms C/Rust due to an AMD CPU bug.

It is software-related. Just the CPU perform badly on some software instruction.
FSRM is a CPU feature embedded in the microcode (in this instance, amd-ucode) that software such as glibc cannot interact with. I refer to it as hardware because I consider microcode a part of the hardware.