From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3f0365b3a22c7556 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!newsfeed.yul.equant.net!newsfeed.uk.prserv.net!prserv.net!news.freedom2surf.net!nntp-peering.plus.net!ptn-nntp-feeder01.plus.net!ptn-nntp-spool02.plus.net!ptn-nntp-reader03.plus.net!not-for-mail Message-ID: <434c69f0$0$73598$ed2619ec@ptn-nntp-reader03.plus.net> From: Jon Harrop Subject: Re: Heap vs Stack allocation Newsgroups: comp.lang.ada Date: Wed, 12 Oct 2005 02:38:16 +0100 References: <434c2709$0$21298$626a54ce@news.free.fr> Organization: Flying Frog Consultancy Ltd. User-Agent: KNode/0.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit NNTP-Posting-Host: 111d2dd2.ptn-nntp-reader03.plus.net X-Trace: DXC=@Y7_Y=:^m?279;olWHS>S=igd3Y`7Rb;>@`8gV4CC7I71mRhSWV:]71h]K9jEdTg105PCcS[NJ6<;gToe@VRVHR4 X-Complaints-To: abuse@plus.net Xref: g2news1.google.com comp.lang.ada:5555 Date: 2005-10-12T02:38:16+01:00 List-Id: Lionel Draghi wrote: > The paper "Java theory and practice: Urban performance legends, > revisited - Allocation is faster than you think, and getting faster" > (http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-lnxw07JavaUrbanLegends) > explains (as far as I understand) how JVMs optimize "on-the-fly" memory > allocation to use stack instead of heap, by using "Escape Analysis". > > My feeling is that those writing JVMs are working hard to guess the data > lifetime and optimize memory allocation accordingly, because the > language is unable to express this data locality. > I think that Ada semantics open much more opportunity to use the stack > (or registers). Note that OCaml allocates primarily on the heap and not the stack and is much faster than Java. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com