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 Path: g2news2.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Mon, 06 Jun 2011 21:06:12 +0200 Organization: A noiseless patient Spider Message-ID: References: <1e5e764d-eb7b-4804-8119-b535ddbe5e7e@32g2000vbe.googlegroups.com> <1a84tm53l1wjx.1xdgsbp25vyd5.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 6 Jun 2011 19:06:10 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="vQOapoBCnbPqo6W3WBfabg"; logging-data="4357"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19I2gbaOL0v+2ToDHNPuJvF" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: <1a84tm53l1wjx.1xdgsbp25vyd5.dlg@40tude.net> Cancel-Lock: sha1:Jnik+DxWQoDDvj7LjmKLBOXhMnc= Xref: g2news2.google.com comp.lang.ada:20621 Date: 2011-06-06T21:06:12+02:00 List-Id: Le 06/06/2011 20:18, Dmitry A. Kazakov a �crit : > The opposite is also possible, unless the OS driver uses user-space > buffers. So I would follow Ludovic's advise, especially in the case of a > compiler where reading overhead is negligible comparing to other > computations per character. > NEVER assess anything about efficiency without measurements! 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). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00