On 16/05/11 14:45 +0200, Paul J Stevens wrote:
> On 05/16/2011 01:26 PM, "Cédric Krier" <[email protected]>" wrote:
> > So after re-reading the psycopg2 doc [1], I could create a thread per query
> > and read the result after which will allow parallelisation of the queries 
> > and
> > will improve the performences.
> 
> It *might* improve performance. Don't assume it will. My guess would be
> diminishing returns kick in pretty fast.

Of course, it will be improvement only in special cases like I explained
previously. And this will not be used by default in trytond as we use other
ways (like bunch of ids, cachings).

> And how is spawning threads per query affected by the GIL?
> 
> http://wiki.python.org/moin/GlobalInterpreterLock

psycopg2 releases the GIL.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpx4nt9RXd30.pgp
Description: PGP signature

Reply via email to