3 ms·
The main criteria for me would be the frequency of execution. Say I have a model that will be retrained every quarter via CI/CD or Airflow DAG. Does it make a h
by alkh 2y ago
The main criteria for me would be the frequency of execution. Say I have a model that will be retrained every quarter via CI/CD or Airflow DAG. Does it make a huge difference for me to have parsing done in 410.71ms in Rust vs 740 ms in Python(a convoluted example,of course)? Probably not. Would 400.71 ms vs 5 min, for example still make a difference? I don't think so either.
It would be a different matter entirely if that piece of code is executed more frequently and is also taking a lot of time as I could save both computing resources and money
- 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.
- rbalicki 2y agoAt Facebook, Python was discouraged because many common tools took seconds to load, even when called with only —-help. :/
- slightwinder 2y agoCurious if really python was the problem there. Especially if I look at the problems of other "fancy" software from Facebook.