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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: GNAT, aggregates and efficiency (Was: Use aggregates) Date: Tue, 12 May 2009 07:58:42 +0200 Organization: Jacob Sparre Andersen Message-ID: References: <4a07fc7a$0$2855$ba620e4c@news.skynet.be> <87prefhq04.fsf@nbi.dk> <62aa80a1-1c0b-4716-ab16-9b6243d97ff2@o27g2000vbd.googlegroups.com> <8a88003e-b3d4-4e6f-8bff-bb993c6e540f@s20g2000vbp.googlegroups.com> NNTP-Posting-Host: 0x5552efa6.adsl.cybercity.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1242107934 9949 85.82.239.166 (12 May 2009 05:58:54 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 12 May 2009 05:58:54 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:KTy+U/GPpTusFht4jA/mZuHmdo0= Xref: g2news2.google.com comp.lang.ada:5775 Date: 2009-05-12T07:58:42+02:00 List-Id: wrote: > Someone recently found it was quicker to test an array for some > condition by looping through it rather than by comparing with an > aggregate [eg X = (others => 0)]. I had naively assumed that GNAT > would just do the comparisons of the elements of X against 0, as the > hand-crafted loop does, rather than construct a whole array of zeros > on the stack and then loop through that ... With which command line arguments and aggregate sizes is this the case? Greetings, Jacob PS: Never make premature local optimization! -- "If I have to choose between two evils, I choose the one I haven't tried before."