[gclist] Java vs. ML, particularly GC

Eliot Moss moss@kiwi.cs.umass.edu
Fri, 22 Dec 2000 14:32:42 -0500 (EST)

>>>>> "Dave" == Dave Mason <dmason@sarg.Ryerson.CA> writes:

    Dave> I have 10-20K lines of coding experience in SML, Caml, Scheme (,
    Dave> and C) and am now building a system in Java (about 5-10K so far).
    Dave> Java (using the Sun VM (not HotSpot)) seems much more sluggish
    Dave> than the functional languages (particularly Ocaml), and the
    Dave> information I've seen on Java performance suggests that garbage
    Dave> production and resulting collection are *major* performance
    Dave> bottlenecks and a programmer caring anything about performance
    Dave> should give serious thought to minimizing the use of dynamic
    Dave> variables.

    Dave> 1) opinions on the accuracy of this perception?

    Dave> 2) are there aspects of Java that will make its GC significantly
    Dave> slower?

I can't speak for that particular implementation, but there are lots of
reasons things could more sluggish than your prior experiences, and my
guess is that folks are (a) either blaming GC in the absence of real
measurement, or (b) it's not a very good implementation. For example, it
might have copying, but not generational GC. The system might be mostly
interpreted and any "JIT" (native) code it might produce might be
poor. Lots of reasons. I don't think Java is inherently slow, though
startup time compared with compile-in-advance languages is likely to be

-- Eliot
J. Eliot B. Moss, Associate Professor     http://www.cs.umass.edu/~moss    www
Department of Computer Science            +1-413-545-4206                voice
140 Governor's Drive, Room 372            +1-413-545-1249                  fax
University of Massachusetts               moss@cs.umass.edu              email
Amherst, MA  01003-4610  USA              +1-413-545-3733 Priscilla Coe  sec'y