[Twisted-Python] Very interesting....
same example coded in eventlet, gevent, twisted, tornado, nodejs, thin+eventmachine http://gist.github.com/376416 (by @greut) Surprising…
Not the first time we've seen these kinds of benchmarks. Microbenchmarks rarely give you interesting information about real world apps. Also: ab ain't a very good HTTP benchmark. But hey, data points are data points. lvh
I didn't notice the benchmarks...good catch. I was more interested in
the conciseness or lack thereof with the various frameworks. Very
surprised that Twisted was nearly as clean and easy to read as the
Eventlet example.
-J
On Sat, Apr 24, 2010 at 12:16 PM, Laurens Van Houtven
Not the first time we've seen these kinds of benchmarks. Microbenchmarks rarely give you interesting information about real world apps. Also: ab ain't a very good HTTP benchmark. But hey, data points are data points. lvh _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On 01:13 am, jasonjwwilliams@gmail.com wrote:
I didn't notice the benchmarks...good catch. I was more interested in the conciseness or lack thereof with the various frameworks. Very surprised that Twisted was nearly as clean and easy to read as the Eventlet example.
This comparison (in the blog post) makes the same mistake that many such comparisons make. The division of libraries into the arbitrary categories of "reactor model" and "coroutine" is artificial. See corotwine for an example of using Twisted and coroutines. And see txwsgi (announced here a week or two ago by Manlio Perillo) for a Twisted-based wsgi container which supports applications that look almost identical to the eventlet/gevent wsgi applications used in this comparison. And take a look at how eventlet and gevent are implemented, and you'll find something that's essentially the same as a Twisted reactor. Jean-Paul
exarkun@twistedmatrix.com ha scritto:
On 01:13 am, jasonjwwilliams@gmail.com wrote:
I didn't notice the benchmarks...good catch. I was more interested in the conciseness or lack thereof with the various frameworks. Very surprised that Twisted was nearly as clean and easy to read as the Eventlet example.
This comparison (in the blog post) makes the same mistake that many such comparisons make. The division of libraries into the arbitrary categories of "reactor model" and "coroutine" is artificial.
[...] And take a look at how eventlet and gevent are implemented, and you'll find something that's essentially the same as a Twisted reactor.
The only significative difference, IMHO, is that eventlet and gevent are able to schedule coroutines directly in the main event loop (since they have full control over it), while with Twisted and Python applications embedded in C servers like Nginx, you have to return control to the "framework" (this what the x-wsgiorg.suspend WSGI extension does). Manlio
On 03:37 pm, manlio_perillo@libero.it wrote:
exarkun@twistedmatrix.com ha scritto:
On 01:13 am, jasonjwwilliams@gmail.com wrote:
I didn't notice the benchmarks...good catch. I was more interested in the conciseness or lack thereof with the various frameworks. Very surprised that Twisted was nearly as clean and easy to read as the Eventlet example.
This comparison (in the blog post) makes the same mistake that many such comparisons make. The division of libraries into the arbitrary categories of "reactor model" and "coroutine" is artificial.
[...] And take a look at how eventlet and gevent are implemented, and you'll find something that's essentially the same as a Twisted reactor.
The only significative difference, IMHO, is that eventlet and gevent are able to schedule coroutines directly in the main event loop (since they have full control over it),
What does "schedule coroutines directly in the main event loop" mean?
while with Twisted and Python applications embedded in C servers like Nginx, you have to return control to the "framework" (this what the x-wsgiorg.suspend WSGI extension does).
It looks like I misremembered the interface provided by txwsgi. I thought it let you switch to another coroutine directly, rather than requiring that you yield an empty string after (the equivalent of) setting a flag. This seems to be more because of WSGI constraints than anything else, though. Jean-Paul
exarkun@twistedmatrix.com ha scritto:
On 03:37 pm, manlio_perillo@libero.it wrote:
exarkun@twistedmatrix.com ha scritto:
On 01:13 am, jasonjwwilliams@gmail.com wrote:
I didn't notice the benchmarks...good catch. I was more interested in the conciseness or lack thereof with the various frameworks. Very surprised that Twisted was nearly as clean and easy to read as the Eventlet example. This comparison (in the blog post) makes the same mistake that many such comparisons make. The division of libraries into the arbitrary categories of "reactor model" and "coroutine" is artificial.
[...] And take a look at how eventlet and gevent are implemented, and you'll find something that's essentially the same as a Twisted reactor. The only significative difference, IMHO, is that eventlet and gevent are able to schedule coroutines directly in the main event loop (since they have full control over it),
What does "schedule coroutines directly in the main event loop" mean?
From the gevent intro.rst:
Unlike other network libraries and similar to eventlet, gevent starts the event loop implicitly in a dedicated greenlet. There's no ``reactor`` that you must ``run()`` or ``dispatch()`` function to call. When a function from gevent API wants to block, it obtains the :class:`Hub` - a greenlet that runs the event loop - and switches to it. If there's no :class:`Hub` instance yet, one is created on the fly. Not sure if you can say that "coroutines are scheduled directly in the main loop".
while with Twisted and Python applications embedded in C servers like Nginx, you have to return control to the "framework" (this what the x-wsgiorg.suspend WSGI extension does).
It looks like I misremembered the interface provided by txwsgi. I thought it let you switch to another coroutine directly,
No, since this would not be possible with a WSGI implementation embedded in Nginx. You *need* to return control to the event loop (process cycle in Nginx).
rather than requiring that you yield an empty string after (the equivalent of) setting a flag. This seems to be more because of WSGI constraints than anything else, though.
Regards Manlio
On Sat, Apr 24, 2010 at 1:20 PM, Jason J. W. Williams
same example coded in eventlet, gevent, twisted, tornado, nodejs, thin+eventmachine http://gist.github.com/376416 (by @greut) Surprising…
In the related blog post the author describes EvenMachine: "It looks like super clean Twisted too me." Looking at the ruby example in gist, I'm trying very hard to figure out what's super clean about it. -Drew
On Apr 28, 2010, at 12:22 PM, Drew Smathers wrote:
On Sat, Apr 24, 2010 at 1:20 PM, Jason J. W. Williams
wrote: same example coded in eventlet, gevent, twisted, tornado, nodejs, thin+eventmachine http://gist.github.com/376416 (by @greut) Surprising…
In the related blog post the author describes EvenMachine: "It looks like super clean Twisted too me." Looking at the ruby example in gist, I'm trying very hard to figure out what's super clean about it.
Using "super clean" and "Ruby" together in the same sentence, in relation to anything more complex than "Hello World", especially on the Twisted list, causes tears in the space-time continuum. Please stop before something gets really broken. Thanks, S
I saw a mention of benchmarks, but no numbers... - would be most interested
in seeing those.
And as for EventMachine - I prefer twisted, but if you gotta be in ruby (as
I do increasingly often), it's great.
cheers,
m
On Wed, Apr 28, 2010 at 9:47 AM, ssteinerX@gmail.com
On Apr 28, 2010, at 12:22 PM, Drew Smathers wrote:
On Sat, Apr 24, 2010 at 1:20 PM, Jason J. W. Williams
wrote: same example coded in eventlet, gevent, twisted, tornado, nodejs, thin+eventmachine http://gist.github.com/376416 (by @greut) Surprising…
In the related blog post the author describes EvenMachine: "It looks like super clean Twisted too me." Looking at the ruby example in gist, I'm trying very hard to figure out what's super clean about it.
Using "super clean" and "Ruby" together in the same sentence, in relation to anything more complex than "Hello World", especially on the Twisted list, causes tears in the space-time continuum.
Please stop before something gets really broken.
Thanks,
S
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (7)
-
Drew Smathers
-
exarkun@twistedmatrix.com
-
Jason J. W. Williams
-
Laurens Van Houtven
-
Manlio Perillo
-
Marc Byrd
-
ssteinerX@gmail.com