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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,123c40d62c632159 X-Google-Attributes: gid103376,public From: aaro@iki.fi (Aaro Koskinen) Subject: Re: Stack based allocation vs. Dynamic allocation Date: 2000/05/31 Message-ID: #1/1 X-Deja-AN: 629354627 References: X-Complaints-To: usenet@news.helsinki.fi X-Trace: oravannahka.helsinki.fi 959758330 7443 128.214.205.10 (31 May 2000 07:32:10 GMT) Organization: University of Helsinki NNTP-Posting-Date: 31 May 2000 07:32:10 GMT Newsgroups: comp.lang.ada Date: 2000-05-31T07:32:10+00:00 List-Id: dale writes: > > time ./heap > 0.01u 0.02s 0:00.18 16.6% > > time ./stack > 17.72u 0.10s 0:19.86 89.7% > > Does anyone know what the factors are that would cause stack > allocation to be so slow? The array sizes were not equal. In the stack version, the loop is about 2000 times longer. A harsh calculation would indicate that the stack allocation was actually quicker. -- Aaro Koskinen, aaro@iki.fi, http://www.iki.fi/aaro