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,9c904699bd33d6e4,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.205.65 with SMTP id fp1mr14115129qab.4.1355223208525; Tue, 11 Dec 2012 02:53:28 -0800 (PST) Received: by 10.49.15.100 with SMTP id w4mr3915796qec.26.1355223208499; Tue, 11 Dec 2012 02:53:28 -0800 (PST) Path: gf5ni48614677qab.0!nntp.google.com!fc2no77311qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 11 Dec 2012 02:53:28 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.241.97.112; posting-account=nd46uAkAAAB2IU3eJoKQE6q_ACEyvPP_ NNTP-Posting-Host: 85.241.97.112 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Performance of static array in record on GNAT / gcc 4.6 From: john@peppermind.com Injection-Date: Tue, 11 Dec 2012 10:53:28 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-12-11T02:53:28-08:00 List-Id: Before I do the measurement myself, I wondered whether someone else has alr= eady done it. Question: If I pass a record with two large, fixed size array= s with definite values to a procedure as in parameter, is there any perform= ance penalty for accessing elements of the arrays inside the record and pro= cedure as opposed to defining the arrays directly inside the procedure and = without wrapping them into a record?=20 I'm using GNAT/gcc 4.6 with -O3 and Pragma Optimize (time) I'm working on a (toy) virtual machine/interpreter where every cycle counts= .=20 Thanks for any advice! P.S.: In case someone asks, yes, I'm considering using assembler but for th= e time being would like to keep it portable.