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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.224.184.73 with SMTP id cj9mr2808934qab.6.1342584301763; Tue, 17 Jul 2012 21:05:01 -0700 (PDT) Received: by 10.66.84.6 with SMTP id u6mr115365pay.31.1342584301695; Tue, 17 Jul 2012 21:05:01 -0700 (PDT) Path: a15ni8267358qag.0!nntp.google.com!x2no10016986qaj.0!news-out.google.com!b9ni161074216pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!mauve.octanews.net!207.246.207.24.MISMATCH!border6.newsrouter.astraweb.com!news.astraweb.com!border6.a.newsrouter.astraweb.com!feed.xsnews.nl!border-1.ams.xsnews.nl!plix.pl!newsfeed2.plix.pl!news.mi.ras.ru!goblin3!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Sun, 15 Jul 2012 23:35:44 +0200 Organization: A noiseless patient Spider Message-ID: References: <01983f1c-f842-4b1f-a180-bcef531dad4c@googlegroups.com> Mime-Version: 1.0 Injection-Date: Sun, 15 Jul 2012 21:35:44 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="709a3b9124d052b085bf6fc3f0a2adab"; logging-data="31515"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IPCnOoaaplNsZYRFg3oMi" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: Cancel-Lock: sha1:ikPCtoWjCvVqgLZ53iEfi0B1u7I= X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-07-15T23:35:44+02:00 List-Id: Le 15/07/2012 21:48, Dmitry A. Kazakov a �crit : >> To access the neighbour A(6) >> > also requires a multiplication. Accessing the array sequentially requires >> > a multiplication per step. > That depends on loop optimizations. I would expect GCC to optimize access > to array elements per the loop's index. > It might depend on the kind of loop, i.e. you may have better optimizations with a for loop than with a while loop where you do the increment yourself. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr