Subj : Re: OO compilers and efficiency To : comp.programming From : Rob Thorpe Date : Fri Jul 22 2005 06:47 am Chris Dollin wrote: > Rob Thorpe wrote: > > > Chris Dollin wrote: > > >> [Do you happen to have cites for any of Lisp, Smalltalk, Pop11, SML, > >> or OCaml doing stack-allocation, 'cos I'd like to chase them up. > >> I'm sure I remember reading stuff about Lisp compilers attempting > >> it; I'm equally - or more - sure that Pop11 doesn't do it.] > > > > I'll look it up, and post a reply when I have. > > Ta muchly. > > I feel a reanimated free-time-burner breathing over my shoulder. > > > I've heard similar things. I read a paper by Zorn long ago that said > > that GC was quicker than malloc/free for some group of programs which > > looked plausible. But since then relative memory latency has > > increased, making GCs that pass over large amount of memory more > > wasteful of performance, so I doubt it's still true. > > That amounts to selection pressure for things like generational > collectors, though, so it might still be true - and the presence > of loadsa memory on typical machines has probably changed the way > store gets manually managed in applications ... so, who knows? I've certainly changed how I use manual management, I'm erring towards being less efficient on memory to allow simpler code. Many programs are transient, ie they input data/files, work then output data and exit. For some of these programs a strategy now is to _just allocate_ without freeing anything, relying on the OS to do it when the program exits. If you can't gaurantee this won't crash the machine, then another strategy is use GC but set it to kick in at ~20MB, so for many uses of the program it never happens. > Oh, for world enough and time. At some point I'll test the effects on GC of todays memory (memory that's vaster than empires and more slow). But not today. .