Re: Getting references to objects without incrementing reference counters

2010-11-16 Thread Artur Siekielski
On Nov 15, 10:06 pm, John Nagle wrote: > On 11/14/2010 11:08 AM, Artur Siekielski wrote: > > > Hi. > > I'm using CPython 2.7 and Linux. In order to make parallel > > computations on a large list of objects I want to use multiple > > processes (by using multiprocessing module). In the first step I

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread John Nagle
On 11/14/2010 11:08 AM, Artur Siekielski wrote: Hi. I'm using CPython 2.7 and Linux. In order to make parallel computations on a large list of objects I want to use multiple processes (by using multiprocessing module). In the first step I fill the list with objects and then I fork() my worker pro

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 15, 5:28 pm, Jean-Paul Calderone wrote: > On Nov 15, 10:42 am, de...@web.de (Diez B. Roggisch) wrote: > > > And circumvene a great deal of the dynamic features in python > > (which you don't need for this usecase, but still are there) > > Great as the features might be, when you don't need

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Jean-Paul Calderone
On Nov 15, 10:42 am, de...@web.de (Diez B. Roggisch) wrote: > And circumvene a great deal of the dynamic features in python > (which you don't need for this usecase, but still are there) > Great as the features might be, when you don't need them, it's clearly a bad thing to have them drag you down

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Diez B. Roggisch
Artur Siekielski writes: > On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: >> You don't say what data you share, and if all of it is needed for each >> child. So it's hard to suggest optimizations. > > Here is an example of such a problem I'm dealing with now: I'm > building large inde

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: > You don't say what data you share, and if all of it is needed for each > child. So it's hard to suggest optimizations. Here is an example of such a problem I'm dealing with now: I'm building large index of words in memory, it takes 50% o

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 14, 10:04 pm, Jean-Paul Calderone wrote: > It might be interesting to try with Jython or PyPy.  Neither of these > Python runtimes uses reference counting at all. I have to use CPython because of C extensions I use (and because I use Python 2.7 features). -- http://mail.python.org/mailman

Re: Getting references to objects without incrementing reference counters

2010-11-14 Thread Diez B. Roggisch
Artur Siekielski writes: > Hi. > I'm using CPython 2.7 and Linux. In order to make parallel > computations on a large list of objects I want to use multiple > processes (by using multiprocessing module). In the first step I fill > the list with objects and then I fork() my worker processes that d

Re: Getting references to objects without incrementing reference counters

2010-11-14 Thread Dan Stromberg
On Sun, Nov 14, 2010 at 11:08 AM, Artur Siekielski < artur.siekiel...@gmail.com> wrote: > Hi. > I'm using CPython 2.7 and Linux. In order to make parallel > computations on a large list of objects I want to use multiple > processes (by using multiprocessing module). In the first step I fill > the

Re: Getting references to objects without incrementing reference counters

2010-11-14 Thread Jean-Paul Calderone
On Nov 14, 11:08 am, Artur Siekielski wrote: > Hi. > I'm using CPython 2.7 and Linux. In order to make parallel > computations on a large list of objects I want to use multiple > processes (by using multiprocessing module). In the first step I fill > the list with objects and then I fork() my work

Getting references to objects without incrementing reference counters

2010-11-14 Thread Artur Siekielski
Hi. I'm using CPython 2.7 and Linux. In order to make parallel computations on a large list of objects I want to use multiple processes (by using multiprocessing module). In the first step I fill the list with objects and then I fork() my worker processes that do the job. This should work optimall