Optimized Rust is Still Slower Than Python+NumPy
1–10 of 15 posts
Re: Optimized Rust is Still Slower Than Python+NumPy
#2Re: Optimized Rust is Still Slower Than Python+NumPy
#3Re: Optimized Rust is Still Slower Than Python+NumPy
#4Re: Optimized Rust is Still Slower Than Python+NumPy
#5Where's the Rust?
Re: Optimized Rust is Still Slower Than Python+NumPy
#6There may be further optimizations you can do to the Rust code, likewise for Python. I do find it a bit hilarious we are "comparing" Python and Rust because really what this "comparison" lets us conclude is "FFI-ing into a mature Fortran library happens to give faster numerical perf than some Rust solution that is naive in comparison."
Let's see how Rust performs with its own FFI into LAPACK and BLAS. Better yet, since I know people will immediately complain Rust isn't a scripting language, let's try to compare something Lua + Torch against Python + PyTorch. This would be much more "apples-to-apples" than whatever OP is doing at the moment.
Re: Optimized Rust is Still Slower Than Python+NumPy
#7Re: Optimized Rust is Still Slower Than Python+NumPy
#8Ah, the classic problem with benchmarking programming languages. There may be further optimizations you can do to the Rust code, likewise for Python. I do find it a bit hilarious we are "comparing" Python and Rust because really what this "comparison" lets us conclude is "FFI-ing into a mature Fortran library happens to give faster numerical perf than some Rust solution that is naive in comparison." Let's see how Rus…
It won't be worth your while optimizing it unless you need to do something that steps outside the bounds of what numpy can easily do (parallel code, lots of small function calls, etc.)
Re: Optimized Rust is Still Slower Than Python+NumPy
#9Where's the Rust?
Re: Optimized Rust is Still Slower Than Python+NumPy
#10I wouldn't be surprised to see Rust numerical libraries created similar to NumPy which also use Fortran, for the same reasons.
If you want a real comparison, try NumPy vs Julia: