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:ac8:5510:: with SMTP id j16mr950798qtq.339.1616435398525; Mon, 22 Mar 2021 10:49:58 -0700 (PDT) X-Received: by 2002:a25:e4c4:: with SMTP id b187mr1118331ybh.92.1616435398333; Mon, 22 Mar 2021 10:49:58 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 22 Mar 2021 10:49:58 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2601:3c3:401:f550:9ee:b41e:1376:69a6; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 2601:3c3:401:f550:9ee:b41e:1376:69a6 References: <07a56dcc-9e17-49b2-a980-3a5a2d265cedn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <23dcce3e-0db1-4417-a5d1-a05f03f74464n@googlegroups.com> Subject: Re: Performance of records with variant parts From: John Perry Injection-Date: Mon, 22 Mar 2021 17:49:58 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61633 List-Id: On Monday, March 22, 2021 at 12:32:39 PM UTC-5, Jeffrey R. Carter wrote: > On 3/22/21 6:02 PM, John Perry wrote: > > > > | case obj.kind is > > | when Sphere => > > | -- do stuff > > | when Plane => > > | -- do other stuff > > | when None => > > | null; > > | end case; > > > > Is there a reason that the record with variant parts runs so much slower? I can make the complete source available if need be. > 1. Why is Surface a discriminant? That's a good question. I don't remember why I made it a discriminant. That's easily fixed. > 2. What are the quantitative timing requirements for the program? Does the > difference affect whether or not they are met? This is a raytracing program. There are no particular timing requirements, but if I wanted a larger image with more objects things would get ugly. This is really more a matter of my curiosity. > 3. What is the declaration of Obj? Obj is an "in" parameter to a function. Do you need more than that? john perry