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,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.59.73 with SMTP id k9mr11603708qah.4.1343130831655; Tue, 24 Jul 2012 04:53:51 -0700 (PDT) Received: by 10.66.77.3 with SMTP id o3mr311504paw.13.1343130731881; Tue, 24 Jul 2012 04:52:11 -0700 (PDT) MIME-Version: 1.0 Path: a15ni78873794qag.0!nntp.google.com!x2no14418246qaj.0!news-out.google.com!p10ni47247208pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nntp.club.cc.cmu.edu!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Wed, 18 Jul 2012 18:11:14 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <9d4d4463-4c7e-40f4-a167-933eb056c6a5@googlegroups.com> NNTP-Posting-Host: Lf0Nl3CcQzx+ocHx9cmuGg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Date: 2012-07-18T18:11:14+00:00 List-Id: > - The data structure and algorithm is optimal from a machine operation > perspective (if we consider the relative speeds of the machine code operations) Taking into account all the fancy pipelining and multiple arithmetic units of the machine you are targeting? How fast does this run in hand optimized asm code? > If we instead store the index of the next element instead of the link, it > is slower because we have to use a relative addressing mode instead of an > absolute one. How about storing not only links to other nodes, but have each node also store a copy of its own index. > to address the neighbours does not make any sense as division is slower > than multiplication. That depends. If the divisor is a power of two you can shift.