Using the unsafe keyword... somehow makes me wonder where else unsafe is used...
Recent adventures in performance optimization with Rust
21–30 of 75 posts
Re: Recent adventures in performance optimization with Rust
#22Earlier quoted context omitted.
I like Python too but let's face it, it is not performant. Why do we have to pretend otherwise?
I think everybody agrees and is not pretending otherwise. But my thing is, I think the problem could be solved in a different way in Python where we can use performant libraries to get an answer in a reasonable time. The author says the naive Python implementation with a for-loop takes 36 milliseconds per iteration, and the problem requires 2.5 billion iterations (= 2.9 years, which is unreasonable) while optimized R…
Re: Recent adventures in performance optimization with Rust
#23Re: Recent adventures in performance optimization with Rust
#24Comparing highly optimized code (including total algorithm rewrite and relying on unsafe and SIMD operations) without doing the same on the other side is a pointless exercise. It's like showing how much faster you can get your handcrafted assembly code to run vs a bash script.
Re: Recent adventures in performance optimization with Rust
#25Comparing highly optimized code (including total algorithm rewrite and relying on unsafe and SIMD operations) without doing the same on the other side is a pointless exercise. It's like showing how much faster you can get your handcrafted assembly code to run vs a bash script.
This format is likely very useful for anyone working on such large sets using Jupyter/Python and waiting days for scripts to complete -- there is nothing wrong with those final tricky optimisations when applied to single-use scripts
I found it a useful reminder that there is often more to be squeezed out on inner loops with a few mins more thought
Re: Recent adventures in performance optimization with Rust
#26Also, I wonder if there is some way to use branch-and-bound to look at fewer combinations.
Re: Recent adventures in performance optimization with Rust
#27The Mojo PR team on their way to hire OP to publish these sort of articles at Modular.
I keep wondering if Mojo will take over the world or somehow become Betamax.
It's just another LLVM frontend.
Also I'm slightly annoyed by the fact that they kept talking about great GPU performance in their marketing material and all you can find in the docs is: "it's coming. probably. only to Nvidia hardware btw."
Re: Recent adventures in performance optimization with Rust
#28want to write fast rust? write your code in C or C++
Fairly complex code like what the author showed turns out to use a bunch of different random things nobody expected.
Re: Recent adventures in performance optimization with Rust
#29> the point of this post isn’t to compare highly-optimized Python to highly-optimized Rust. The point is to compare “standard-Jupyter-notebook” Python to highly-optimized Rust. I guess the title gets clicks, but I'm curious how good python gets. I'm under the impression pandas is pretty fast despite it being python
Pandas can be pretty fast, but DuckDB and Polars are both faster than Pandas. DuckDB supports vectorized and parallelized operations on Pandas dataframes, while Polars is written in Rust. I feel though the killer is that inner loop where dataframe operations are being performed across a large number of iterations, and there's significant overhead there. For-loops are usually not the most performant solution in Python…
Re: Recent adventures in performance optimization with Rust
#30Using the unsafe keyword... somehow makes me wonder where else unsafe is used...