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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Fri, 11 May 2018 01:07:47 -0700 Organization: A noiseless patient Spider Message-ID: <87bmdm4nu4.fsf@nightsong.com> References: <322f9b26-01de-4753-bb50-6ef2f3d993d8@googlegroups.com> <87a7th9pd1.fsf@nightsong.com> <87h8no1nli.fsf@nightsong.com> <874ljo1hvy.fsf@nightsong.com> <87vac4z2lh.fsf@nightsong.com> <87lgcszjdn.fsf@nightsong.com> <87sh6z1kkg.fsf@nightsong.com> <87k1sb1dt3.fsf@nightsong.com> <87h8nfyu40.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="4776ca6b408eab45c2cc0c9a5f8c8c74"; logging-data="23933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cr/yxHT9fWlhHwb2zMtR3" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:I5KoPDVhWzIse4q3m5zBbM+RYs4= sha1:PpHPZDdM41lEMrtKZNygEOYegI8= Xref: reader02.eternal-september.org comp.lang.ada:52251 Date: 2018-05-11T01:07:47-07:00 List-Id: Niklas Holsti writes: > Perhaps the compiler is being asked to optimise the code, which is > probably useless for this package. Try it with very low optimisation > level? Yeah I thought of that and will figure out how to do it. It still shouldn't be THAT slow though. Something weird is going on with the code and/or the compiler. The 1 ghz ARM box that took 1.5 minutes to compile it is slow by today's standards but it's much faster than the servers and workstations in use at the time GNAT was written. If you actually look at the CBSG, it's full of case statements like case R33 is when 1 => return "key people"; when 2 => return "human resources"; when 3 => return "customers"; ... (33 total cases) R33 is a function defined in delerium.adb as follows: function R33 return T33 is begin return T33 (R (33)); end; T33 and R33 are declared in delerium.ads like this: type T33 is range 1 .. 33; function R33 return T33; where R is -- R (N) returns a random number between 1 and N. function R (N : Positive) return Positive; There are similar definitions to T33 and R33 for all the integers from 1 to 500. I.e. 500 integer range types T1...T500 and 500 random number functions R1...R500, one for each of those types. A Pentagon-like approach to software architecture, if you will. So I wonder if that might be slowing the compiler down.