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: a07f3367d7,c8acfc87fbb1813d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Timing code blocks Date: Fri, 05 Mar 2010 20:17:27 +0000 Organization: A noiseless patient Spider Message-ID: References: <2d5bead9-72f9-4c84-9ac1-a058c2591ef1@c37g2000prb.googlegroups.com> <4b90bf24$0$1979$4f793bc4@news.tdc.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 5 Mar 2010 20:17:28 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="28040"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lFua2hvJq0VWL09OcA5XBYT855Da4lgU=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) Cancel-Lock: sha1:o5YMzANeEkj09T3RU4WdSEnH8W0= sha1:2oKCQih+BUjsQOLy1bTrJrEGcsw= Xref: g2news1.google.com comp.lang.ada:9436 Date: 2010-03-05T20:17:27+00:00 List-Id: I found the same results as Niklas, the compiler I'm running is gcc version 4.5.0 20100221 (experimental) [trunk revision 156937] (GCC) for x86_64-apple-darwin10.2.0. I just added Junk_In : Natural := 0; pragma Volatile (Junk_In); -- <===== after which -O[0123] all gave pretty similar results. I didn't have to add 'delay 0.0;' to get the timings. I did set Test_Dur : constant := 10_000; and the timings on this Macbook Pro (2.4 GHz Core 2 Duo are of order 0.292 with -gnato, 0.254 without. The second loop is quicker with -O0.