From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ae9:f719:: with SMTP id s25mr13830395qkg.42.1616773495010; Fri, 26 Mar 2021 08:44:55 -0700 (PDT) X-Received: by 2002:a25:1883:: with SMTP id 125mr19421231yby.465.1616773494810; Fri, 26 Mar 2021 08:44:54 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!50.7.236.18.MISMATCH!fdc3.netnews.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 26 Mar 2021 08:44:54 -0700 (PDT) In-Reply-To: <86h7kyapsn.fsf@stephe-leake.org> Injection-Info: google-groups.googlegroups.com; posting-host=2601:3c3:401:f550:9868:5b48:2776:3dcb; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 2601:3c3:401:f550:9868:5b48:2776:3dcb References: <07a56dcc-9e17-49b2-a980-3a5a2d265cedn@googlegroups.com> <23dcce3e-0db1-4417-a5d1-a05f03f74464n@googlegroups.com> <302c2e86-2379-46e0-b1f7-d69e7e14f9cfn@googlegroups.com> <86h7kyapsn.fsf@stephe-leake.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3b3ff9aa-26b9-4da7-82de-a5f6c1980335n@googlegroups.com> Subject: Re: Performance of records with variant parts From: John Perry Injection-Date: Fri, 26 Mar 2021 15:44:55 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2718 Xref: reader02.eternal-september.org comp.lang.ada:61658 List-Id: On Friday, March 26, 2021 at 10:38:22 AM UTC-5, Stephen Leake wrote: > As a workaround, you can suppress checks in that block of code:=20 >=20 > pragma Suppress (Discriminant_Check);=20 Sorry, I should have updated earlier. I discovered tried this a couple of n= ights ago, and it did nothing to help. I checked the IR and that did change= , so it certainly did something; it just didn't improve the performance as = I expected. It has made me think that perhaps the problem is elsewhere, but= I have no idea where. So, thank you very much for remembering this and getting back to me! But by= now I've concluded that gprof misled me. Wouldn't be the first time. The d= ifference in performance is real, but must be caused elsewhere. I don't eve= n feel confidence submitting an enhancement request to AdaCore because by n= ow I have no idea what the problem is. For what it's worth: I reimplemented it a fourth time as tagged records, an= d while the code is quite a bit wordier, it was more efficient than variant= records. (I also tried examining the generated assembly code, but I'm not strong eno= ugh in assembly to work that out.)