From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5f83:: with SMTP id j3mr4761682qta.149.1626366591845; Thu, 15 Jul 2021 09:29:51 -0700 (PDT) X-Received: by 2002:a25:690e:: with SMTP id e14mr6404334ybc.277.1626366591655; Thu, 15 Jul 2021 09:29:51 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.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: Thu, 15 Jul 2021 09:29:51 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=86.28.147.129; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 86.28.147.129 References: <5a1cegtfm5ibqej3ldebpc4g99ujniqt9u@4ax.com> <0e6ee3e9-baad-47b3-872b-90ec6c735920n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <59c3fb8e-6866-4ea9-a1a2-21fdff252095n@googlegroups.com> Subject: Re: Not good for Ada endorsement From: Lucretia Injection-Date: Thu, 15 Jul 2021 16:29:51 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62393 List-Id: On Thursday, 15 July 2021 at 16:56:40 UTC+1, Jeffrey R. Carter wrote: > On 7/15/21 5:13 PM, Lucretia wrote: > > > > I managed to get just under 4000 passes with a 1 bit array, but not using Ada's packed array. That's actually the slowest method, strangely. > So you have an array of a modular type, calculate an index and bit within it, > mask out that bit, and compare it to zero? I would have thought an unpacked > array of Boolean would be fastest. Doesn't seem to be. Also, the guy is using the packed bit as the final test of all the languages. > A packed array of Boolean requires all the operations above, plus shifting the > bit to the LSB and treating the result as a Boolean, so it may not be that Don't need to shift to the LSB, only need to shift the 1 to the bit location you want to test, invert and then check against 0. > surprising that it's slower. I know. I would've thought the compiler would've handled the packed array as a special case and optimised as much as possible there.