Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, for real life applications as well, I shy away from Python for anything where performance might one day be an issue. Most languages can at least get within an order of magnitude of state of the art (at which point ergonomic considerations can matter more), but Python is just incredibly slow in practice.


>I shy away from Python for anything where performance might one day be an issue if there are only a few bottlenecks that have a significant impact on the performance you could rewrite only those parts to C/Rust. This might be a good aproach especially in a situation where performance is not an issue right now but might be in future. When it actually becomes an issue only the part that actually affects the performance could then be rewritten to C. Of course this approach doesn't always make much sense, but quite often there is a small part of the code that impacts the performance the most and only that part would need to be rewritten, while the rest of the code could still enjoy a language more productive to write in. Similarly a microservice(ish) architecture comes handy with this


In a language as slow as Python where even basic memory copying is slow, you don't really just have a few bottlenecks. You can optimize the most important 10% of the code and the rest of the code will still be slowing everything down. It's also a lot of work to have to rewrite parts in C/Rust and interface with Python code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: