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

>is actually faster than Node.js

Uhhh I call BS until proven otherwise. Maybe the event loop is faster, but I'm willing to bet the callback code is slower.



> Maybe the event loop is faster, but I'm willing to bet the callback code is slower.

This is exactly the case, and the slowdown is pretty noticeable IMO. Still, python 3 is a whole lot better at this than python 2.


The "proof" (benchmarks, yeah, I know) is in the provided link. Feel free to shoot them down.

Anyway, slower or not, writing a small async service is still easier in Node.js. You can trust that no libraries block your event loop and I'm not sure there's quite anything like Express (simplicity+popularity) for async Python just yet.


>The "proof" (benchmarks, yeah, I know) is in the provided link. Feel free to shoot them down.

I just did: those benchmarks show uvloop's performance, not python's, i.e.: they're designed to minimize time spent in callback code.


the callback code being slower is actually a feature in my opinion.. http://stackoverflow.com/questions/18542484/why-callbacks-ar...


I'm struggling to see where in the wall of text this notion is supported.

This smells of mental gymnastics.

I'm a huge fan of python (though I much prefer twisted to aio), but slower callbacks are unequivocally worse than faster ones, all other things being equal (which of course, they never are).


Depends on many things. What task are you trying to accomplish?


In any non-contrived example, CPython's callback code will be slower than equivalent JIT-ed code from v8.

Please don't play the "it depends" card just to be smug. It lowers the level of discourse.


I ain't being smug. If I were, I might use fancy words like "discourse". But we're not playing cards here, are we?

JIT-ed code can be pretty fast, but so can calls to libraries like NumPy. PyPy can also be somewhat speedy, though it hasn't had as much dev time as v8. And if you somehow find yourself breaking new ground with an algorithm no one's written a fast implementation of yet, there's always Cython.

Besides, if there's any task that takes more than a negligible amount of time, I usually push it to a different process and respond immediately. The callback speed in that case is bound by the time it takes to write to a message queue or append to a database table, not the language itself.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: