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,2a687662f09731bb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: Request for comments on simple Ada program Date: 15 Nov 2005 10:29:45 -0800 Organization: http://groups.google.com Message-ID: <1132079385.862345.261290@g49g2000cwa.googlegroups.com> References: NNTP-Posting-Host: 209.194.156.4 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1132079391 10709 127.0.0.1 (15 Nov 2005 18:29:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 15 Nov 2005 18:29:51 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=209.194.156.4; posting-account=SqOfxAwAAAAkL81YAPGH1JdBwpUXw9ZG Xref: g2news1.google.com comp.lang.ada:6399 Date: 2005-11-15T10:29:45-08:00 List-Id: Maciej Sobczak wrote: > Hi, > > While playing with Ada and exercising its constructs, I have written the > following classic Sieve of Eratosthenes: In addition to the other suggestions you might also experiment with using a packed array of boolean. The space savings from packing the array will frequently result in an array that will be kept in the CPU cache. Even though it is less efficient to access individual bits, the program execution speed, by my measurements, will increase by a factor of approximately 3. The execution advantage is explained by the lack of I/O overhead to off-cpu memory. Jim Rogers