On Wed, 15 Feb 2006 12:03:42 -0700, Jonathan Ellis <[EMAIL PROTECTED]> wrote:
Additionally, thread pooling is a simple optimization that can be added to
"normal" code that can in many cases give you 90% of the benefit of a pure
async-oriented approach like Twisted's, with much less complexity.  (In some
cases, thread pooling can even be faster, if it can spare you Twisted's
overhead of a dozen or so function calls per operation...)

Besides that Twisted provides a thread pool which means that practicality
beated purity once again ;P, your statement requires some measurements at
least.

From what I measured with a thread pool of varying size (from 1 to 5 threads
with 13 concurrent database queries) using one thread resulted in an overall
faster execution (not by a great margin but still faster and consistently
so). Not only this but using one thread each request finished in less time
than with 5 threads (about 5 times faster or similar) because not being run
in parallel they don't need to share execution time with the others thus
providing an higher completion time but a shorter response time.

If you want them I can reproduce the results again and provide them to the
list.

From another real world 'benchmark', using pgasync db adapter for postgresql
(pure python postgresql adapter written in Twisted to be completely async)
showed how:
1) pgasync was _faster_ than psycopg2 (written in C) with high concurrency
(and about the same speed with low concurrency or one user).
2) pgasync was able to deal with much heavier loads. In fact it was able to
keep up a New York Times banner campaign that generated over 150.000 unique
hits in a morning on a single machine without any problems.

--
Valentino Volonghi aka Dialtone
Now Running MacOSX 10.4
Blog: http://vvolonghi.blogspot.com
New Pet: http://www.stiq.it


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to