Hacker News new | ask | show | jobs
by simonw 2609 days ago
I don't think I've ever seen a commercial Python codebase that actually did rewrite things in C for speed.

Much more likely is using a library like NumPy where someone else has done that C performance work for you.

Plus in 2019, it's much cheaper to design for horizontal scale and spin up a few more instances.

1 comments

I have personally rewitten a number of expensive inner loops into C to make Python be less slow. It is easy (if you find it hard Go wont be an option for you). I would say the argument against Python is not raw speed but concurrency model. I use gevent for io bouns studf but going multi CPU with data sharing is hard for the engineer and slow for the code compared to Go and goroutines. Subprocesses are ok and sending data over sockets is ok but serialization several times is sucky. Worse than extra memcpy. Also one big msg can block your interpreter.