Interesting speed benchmark

Rainer Deyke root at rainerdeyke.com
Wed Jun 6 23:29:47 EDT 2001


"Michael P. Soulier" <msoulier at storm.ca> wrote in message
news:aRBT6.147831$eK2.35759519 at news4.rdc1.on.home.com...
> On Wed, 06 Jun 2001 18:00:48 -0600, Mahesh Padmanabhan
> <micronospampad at nospam.yahoo.com> wrote:
> >
> > Seems like that poster was correct in pointing out that the memory
> > management scheme of Java vs Python makes a difference.
>
>     What are the disadvantages of this kind of "lazy garbage collection"?

Basically that you have to do manual resource management for non-memory
resources.

The following function leaks a file handle under Jython but works correctly
under CPython:

def print_file(fname):
  file = open(fname)
  print file.read()


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list