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,FREEMAIL_FROM autolearn=ham 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-7-bit Received: by 10.224.184.73 with SMTP id cj9mr2744189qab.6.1342580087539; Tue, 17 Jul 2012 19:54:47 -0700 (PDT) Received: by 10.66.79.169 with SMTP id k9mr98722pax.18.1342580087472; Tue, 17 Jul 2012 19:54:47 -0700 (PDT) Path: a15ni8267358qag.0!nntp.google.com!x2no8588133qaj.0!news-out.google.com!p10ni160677412pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!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!goblin2!goblin1!goblin.stu.neva.ru!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Keean Schupke Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Sun, 15 Jul 2012 14:08:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <44f2bfd0-75ed-4b9c-982e-61d5308f9c01@googlegroups.com> NNTP-Posting-Host: 82.44.19.199 Mime-Version: 1.0 X-Trace: posting.google.com 1342386518 17474 127.0.0.1 (15 Jul 2012 21:08:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 15 Jul 2012 21:08:38 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.44.19.199; posting-account=T5Z2vAoAAAB8ExE3yV3f56dVATtEMNcM User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-15T14:08:37-07:00 List-Id: On Sunday, 15 July 2012 22:05:05 UTC+1, (unknown) wrote: > > as the use of Indexes was too slow. An example of this is lets say we are a= > > ccessing element 5 from array A "A(5)" this requires a multiplication to ac= > > cess (base_address + index * record_size). To access the neighbour A(6) als= > Can you reasonably pad the element size to a power of two so the > multiplication can be replaced by a shift? It would be interesting to see > the result, in various hardware contexts. Actually in my actual use case the record is 32 bytes, and it does use a shift right by 5 instead of a multiply, but this is still 10k simulations per second slower that the pointer arithmetic version. Cheers, Keean.