Hey Tony,

On Fri, Jan 22, 2010 at 10:11 AM, Tony Nelson
<tonynel...@georgeanelson.com> wrote:
> On 10-01-22 02:53:21, Collin Winter wrote:
>> On Thu, Jan 21, 2010 at 11:37 PM, Glyph Lefkowitz
>> <gl...@twistedmatrix.com> wrote:
>> >
>> > On Jan 21, 2010, at 6:48 PM, Collin Winter wrote:
>  ...
>> > There's been a recent thread on our mailing list about a patch that
>> > dramatically reduces the memory footprint of multiprocess
>> > concurrency by separating reference counts from objects. ...
>
> Currently, CPython gets a performance advantage from having reference
> counts hot in the cache when the referenced object is used.  There is
> still the write pressure from updating the counts.  With separate
> reference counts, an extra cache line must be loaded from memory (it is
> unlikely to be in the cache unless the program is trivial).  I see from
> the referenced posting that this is a 10% speed hit (the poster
> attributes the hit to extra instructions).
>
> Perhaps the speed and memory hits could be minimized by only doing this
> for some objects?  Only objects that are fully shared (such as read-
> only data) benefit from this change.  I don't know but shared objects
> may already be treated separately.

One option that we discussed was to create a ./configure flag to
toggle between inline refcounts and separate refcounts. Advanced users
that care about the memory usage of multiprocess concurrency could
compile their own CPython binary to enable this space optimization at
the cost of some performance.

On the other hand, once we get enough performance out of the JIT that
python-dev is willing to take a 10% hit, then I'd say we should just
turn the space optimization on by default. In the meantime, though, a
configure flag would be a useful intermediate point for a number of
people.

Collin Winter
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to