Interesting speed benchmark

Mats Wichmann xyzmats at laplaza.org
Wed Jun 6 09:49:45 EDT 2001


On Wed, 6 Jun 2001 16:28:29 +0700, "Andy Salnikov"
<salnikov at inp.nsk.su> wrote:

>
>"Aahz Maruch" <aahz at panix.com> wrote in message
>news:9fkh50$6e1$1 at panix6.panix.com...
>
>> My guess is that this represents a pathological case for Python's memory
>> management system.  Each time through the outer loop after the first,
>> Python has to walk the chain of 10K objects, deallocating them
>> one-by-one
>
>I'd better say that it represents a pathological case for Java memory
>management, which does not bother to destroy unreachable objects and instead
>eats up memory like a pig:) Anyone compared memory usage in these two tests?

That's because Java leaves that to the gabage collector. Which is
quite sophisticated but to us mere mortals often presents the image of
"yeah, yeah, I'll get around to it. Maybe tomorrow."  But this sounds
like a place where it would do okay, because the whole wonky chain of
10000 objects can be reaped by the gc.

Nonetheless, I'm not convinced that's what's going on here.
Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the
address xyzmats at laplaza.org. Not that it helps much...)



More information about the Python-list mailing list