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: 103376,103803355c3db607 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.162 with SMTP id wj2mr1668861pbc.2.1340966930559; Fri, 29 Jun 2012 03:48:50 -0700 (PDT) Path: l9ni32987pbj.0!nntp.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT (GCC) Profile Guided Compilation Date: Fri, 29 Jun 2012 11:48:10 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="SoFK8VDXrxbuZRJrGYNncQ"; logging-data="20271"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fkjQRK8S6TbrikS5f1LGmKCK+TGiYDY4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (darwin) Cancel-Lock: sha1:6xjdU+cki5crAm5C4wMo9cGyi2Q= sha1:QS7Oum+CCGMX/3vPCebsMWKPB78= X-Received-Bytes: 1860 Content-Type: text/plain Date: 2012-06-29T11:48:10+01:00 List-Id: Keean Schupke writes: > I am developing a Monte-Carlo simulation engine, and I have > implementations in C++ and Ada. All performance figures come from the > same reference hardware. Both are built using GCC, and similar > optimisation is applied to each (same optimisation level, cpu arch, > inlining etc). > > My C++ implementation achieves 40,000 simulations per second. > > My Ada port initially achieves 32,000 iterations per second. > > I refactored the Ada port to use System.Address to access the main > data structure (as in the 'C++' version benchmarking showed a clear > performance benefit to *ptr_x compared to array[x]) > > The Ada port using System.Address achieves 40,000 simulations per > second - so this is looking good. Did you try -gnatp (suppress all checks)? (only to be used when you're sure the code is correct!) You could also use pragma Suppress at the hot spots.