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,b5cd7bf26d091c6f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Mon, 6 Jun 2011 22:15:41 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1e5e764d-eb7b-4804-8119-b535ddbe5e7e@32g2000vbe.googlegroups.com> <1a84tm53l1wjx.1xdgsbp25vyd5.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1307416543 406 69.95.181.76 (7 Jun 2011 03:15:43 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 7 Jun 2011 03:15:43 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:20636 Date: 2011-06-06T22:15:41-05:00 List-Id: "J-P. Rosen" wrote in message news:isj8f2$485$1@dont-email.me... ... > I once doubled the speed of a compiler by rewriting the main character > reading procedure in assembly. A compiler spends more time than you > would think simply skipping spaces... > (Yes, I did measure that - TBH, it was quite a long time ago, on a > computer that was very different from what we have today). System calls are expensive on every machine I've ever seen. I've yet to see a case where it is better to let the system buffer the input rather than do it yourself. I ended up moving that into Ada.Text_IO after dealing with customers that were not willing to believe that fact. As far as compilers go, I recall that most of the syntax pass was coded in assembler in the early days of Janus/Ada; and it far more than doubled the speed over the Ada version (it was closer to a factor of 10). We maintained both versions for many years. On more modern machines, with compilers that have much better optimization, I've been able to get rid of that assembler code. Randy.