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 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.78.6 with SMTP id x6mr4472724paw.42.1356837702084; Sat, 29 Dec 2012 19:21:42 -0800 (PST) Path: 6ni71714pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!backlog1.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!weretis.net!feeder1.news.weretis.net!news.szaf.org!news.gnuher.de!news.enyo.de!.POSTED!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Performance of static array in record on GNAT / gcc 4.6 Date: Wed, 26 Dec 2012 16:15:34 +0100 Message-ID: <87ehic26ax.fsf@mid.deneb.enyo.de> References: Mime-Version: 1.0 X-Trace: news.enyo.de 1356534933 11004 172.17.135.6 (26 Dec 2012 15:15:33 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:3ZZdh/4CgcDh6Mo3k18nrZmaouY= X-Original-Bytes: 1330 Content-Type: text/plain; charset=us-ascii Date: 2012-12-26T16:15:34+01:00 List-Id: > Before I do the measurement myself, I wondered whether someone else > has already done it. Question: If I pass a record with two large, > fixed size arrays with definite values to a procedure as in > parameter, is there any performance penalty for accessing elements > of the arrays inside the record and procedure as opposed to defining > the arrays directly inside the procedure and without wrapping them > into a record? There shouldn't be a difference in performance. You could verify this by comparing the generated machine code.