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,aa14979d20ba3045 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 12 May 2009 13:07:25 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Use aggregates (Was: Allocation question) References: <4a07fc7a$0$2855$ba620e4c@news.skynet.be> <87prefhq04.fsf@nbi.dk> <62aa80a1-1c0b-4716-ab16-9b6243d97ff2@o27g2000vbd.googlegroups.com> <26af755b-0b90-429f-a688-86bf307da2b5@o20g2000vbh.googlegroups.com> <4hji05lus782p2r186n8v51t1tpv3tbm0l@4ax.com> In-Reply-To: <4hji05lus782p2r186n8v51t1tpv3tbm0l@4ax.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a09586d$0$30224$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 12 May 2009 13:07:25 CEST NNTP-Posting-Host: fa70df00.newsspool1.arcor-online.net X-Trace: DXC=PBaj6nOO86HC4i^e1BZ=_Hic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbI8=K?`;jhVXE;9OJDO8_SKFNSZ1n^B98iJ4]R@j`TXLNG X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:5787 Date: 2009-05-12T13:07:25+02:00 List-Id: Brian Drummond schrieb: > If anything gives Ada the reputation for inefficiency and bloat, it's that sort > of missed opportunity, and not the language itself. (Did you try this with C99's variable length arrays?) > There is no fundamental reason why the compiler can't do as good a job as I can > at unrolling that into loops. And unfortunately, you have thrown away half the > point of using Ada, if you have to write C in Ada to match the performance of C. GNAT does seem to emit loop instructions for the following input. I get a REPZ in the assembly listing. What do you get? package A is pragma Pure; subtype Intensity is Natural range 0 .. 255; type Index is range 1 .. 100; type List is array(Index) of Intensity; Zero: constant List := List'(others => 0); function Is_Zero(Item: List) return Boolean; end A; package body A is function Is_Zero(Item: List) return Boolean is begin return Item = Zero; end Is_Zero; end A;