Rust std fs slower than Python? No, it's hardware
31–40 of 255 posts
Re: Rust std fs slower than Python? No, it's hardware
#32>Rust std fs slower than Python!? No, it's hardware! >... >Python features three memory domains, each representing different allocation strategies and optimized for various purposes. >... >Rust is slower than Python only on my machine. if one library performs wildly better than the other in the same test, on the same hardware, how can that not be a software-related problem? sounds like a contradiction. Maybe should b…
The root cause is AMD's bad support for rep movsb (which is a hardware problem). However, python by default has a small offset when reading memories while lower level language (rust and c) does not, which is why python seems to perform better than c/rust. It "accidentally" avoided the hardware problem.
Re: Rust std fs slower than Python? No, it's hardware
#33I am curious if this is something that everyone can do to get free performance or if there are caveats. Can C codebases benefit from this too? Is this performance that is simply left on table currently?
Re: Rust std fs slower than Python? No, it's hardware
#34> Rust developers might consider switching to jemallocator for improved performance I am curious if this is something that everyone can do to get free performance or if there are caveats. Can C codebases benefit from this too? Is this performance that is simply left on table currently?
Rust used to use jemalloc by default but switched as people found this surprising as the default.
Re: Rust std fs slower than Python? No, it's hardware
#35> Rust developers might consider switching to jemallocator for improved performance I am curious if this is something that everyone can do to get free performance or if there are caveats. Can C codebases benefit from this too? Is this performance that is simply left on table currently?
Re: Rust std fs slower than Python? No, it's hardware
#36Disclaimer: 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.
Re: Rust std fs slower than Python? No, it's hardware
#37Disclaimer: 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.
What's the TLDR on how... hardware performs differently on two software runtimes?
> In conclusion, the issue isn't software-related. Python outperforms C/Rust due to an AMD CPU bug.
Re: Rust std fs slower than Python? No, it's hardware
#38Disclaimer: 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.
What's the TLDR on how... hardware performs differently on two software runtimes?
Re: Rust std fs slower than Python? No, it's hardware
#39Earlier quoted context omitted.
What's the TLDR on how... hardware performs differently on two software runtimes?
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.
Re: Rust std fs slower than Python? No, it's hardware
#40>Rust std fs slower than Python!? No, it's hardware! >... >Python features three memory domains, each representing different allocation strategies and optimized for various purposes. >... >Rust is slower than Python only on my machine. if one library performs wildly better than the other in the same test, on the same hardware, how can that not be a software-related problem? sounds like a contradiction. Maybe should b…
The root cause is AMD's bad support for rep movsb (which is a hardware problem). However, python by default has a small offset when reading memories while lower level language (rust and c) does not, which is why python seems to perform better than c/rust. It "accidentally" avoided the hardware problem.
But since python runtime is written in C, the issue can't be Python vs C.