comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Not good for Ada endorsement
Date: Fri, 9 Jul 2021 11:16:24 +0200	[thread overview]
Message-ID: <sc9458$2rq$1@dont-email.me> (raw)
In-Reply-To: <d4b4342e-b2ef-4ed3-a586-85b4c5c8bd9dn@googlegroups.com>

On 7/9/21 10:33 AM, Egil H H wrote:
> 
> On my computer, at least, GNAT is not happy about incrementing Number by 2
> in the inner loop. I get a bit better performance by modifying the check to
> 
>        if Number mod 2 /= 0 and then Sieve.Bits(Index_Type(Number)) then
> 
> and then incrementing Number by 1.

Since both operands are positive, mod and rem give the same results, and rem is 
usually a bit faster. It's normally not an issue, but in this case it's done 
billions of times, so it might make a difference.

-- 
Jeff Carter
"Oh Lord, bless this thy hand grenade, that with it thou
mayst blow thine enemies to tiny bits, in thy mercy."
Monty Python and the Holy Grail
24

  reply	other threads:[~2021-07-09  9:16 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 14:21 Not good for Ada endorsement Richard Iswara
2021-07-07 15:06 ` Luke A. Guest
2021-07-07 15:19   ` Doctor Who
2021-07-07 19:21     ` Simon Wright
2021-07-07 19:49       ` Doctor Who
2021-07-07 20:39         ` Luke A. Guest
2021-07-08  3:46         ` Richard Iswara
2021-07-08  8:20           ` Jeffrey R. Carter
2021-07-08  8:42             ` Dmitry A. Kazakov
2021-07-08  8:52             ` Luke A. Guest
2021-07-08 10:42             ` Jeffrey R. Carter
2021-07-08 10:51               ` Luke A. Guest
2021-07-08 11:12                 ` Jeffrey R. Carter
2021-07-08 17:37                   ` Luke A. Guest
2021-07-08 17:43                     ` Luke A. Guest
2021-07-08 19:16                       ` Luke A. Guest
2021-07-08 19:16                     ` Luke A. Guest
2021-07-09  2:47                       ` Richard Iswara
2021-07-09  8:10                     ` Paul Rubin
2021-07-09  8:24                       ` Egil H H
2021-07-09  8:33                     ` Egil H H
2021-07-09  9:16                       ` Jeffrey R. Carter [this message]
2021-07-09  9:21                         ` Jeffrey R. Carter
2021-07-15 15:13                           ` Lucretia
2021-07-15 15:56                             ` Jeffrey R. Carter
2021-07-15 16:29                               ` Anh Vo
2021-07-15 17:30                                 ` Lucretia
2021-07-16 16:27                                   ` Simon Wright
2021-07-16 16:28                                   ` Simon Wright
2021-07-23 17:55                                     ` Luke A. Guest
2021-07-23 17:04                                 ` Anh Vo
2021-07-23 17:12                                   ` Luke A. Guest
2021-07-15 16:29                               ` Lucretia
2021-07-15 16:49                                 ` Dmitry A. Kazakov
2021-07-15 21:08                                 ` Jeffrey R. Carter
2021-07-11 15:54 ` Dennis Lee Bieber
2021-07-18 23:03 ` Mace Ayres
2021-07-19  1:00   ` Paul Rubin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox