News for hackers. Stuff that matters.
Re:Key differences between Python 2.7.x and Python 3.x (2014) by omginternets on Sunday May 07, 2017 @04:48PM (#14287577)
>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.

Re:Key differences between Python 2.7.x and Python 3.x (2014) by nicoburns on Sunday May 07, 2017 @05:18PM (#14287733)
> 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.

Re:Key differences between Python 2.7.x and Python 3.x (2014) by elnygren on Monday May 08, 2017 @04:16AM (#14290018)
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.

Re:Key differences between Python 2.7.x and Python 3.x (2014) by omginternets on Monday May 08, 2017 @12:03PM (#14292789)
>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.

Re:Key differences between Python 2.7.x and Python 3.x (2014) by tuco86 on Monday May 08, 2017 @02:19AM (#14289623)
the callback code being slower is actually a feature in my opinion.. http://stackoverflow.com/questions/18542484/why-callbacks-ar...
Re:Key differences between Python 2.7.x and Python 3.x (2014) by omginternets on Monday May 08, 2017 @12:07PM (#14292838)
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).

Re:Key differences between Python 2.7.x and Python 3.x (2014) by xapata on Monday May 08, 2017 @01:18AM (#14289408)
Depends on many things. What task are you trying to accomplish?
Re:Key differences between Python 2.7.x and Python 3.x (2014) by omginternets on Monday May 08, 2017 @02:25PM (#14294217)
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.

Re:Key differences between Python 2.7.x and Python 3.x (2014) by xapata on Wednesday May 10, 2017 @04:47AM (#14306810)
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.