4 ms·
> 400.71 ms vs 5 min That spread in performance is not realistic though. Of course rust is that much faster, I have no doubt that you could 100x the performanc
by qsort 2y ago
> 400.71 ms vs 5 min
That spread in performance is not realistic though. Of course rust is that much faster, I have no doubt that you could 100x the performance of equivalent python, the problem is that it's an imaginary scenario. Nobody is writing a tight loop in python, you're delegating to pandas/polars, SQL, external calls or what have you.
Nobody cares that the code that initializes a call to a 10-minute training run of Xgboost takes 0.001 seconds instead of 0.1 seconds. Nobody cares if you fearlessly optimize the 7 lines of code to connect to a database, whose runtime is dwarfed by a SQL query over the wire.
I don't want to come off as negative towards rust, I do think it's a great language, I'm just really perplexed when people try to use it in contexts that are far removed from its sweet spot.
- alkh 2y agoI agree with you overall but there's a huge caveat: you need to make sure whoever is writing the code in Python has performance in mind. The problem I encounter a lot is that many Data Scientists write unoptimized code that is taking longer to run than it should(ex. using for loops instead of numpy vectorization). You could have inefficient code in Rust as easily but even then the runtime difference would be the same.