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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 06 Aug 2009 00:31:00 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <0c18b36c-7af0-454c-8208-9b0416111a1f@w41g2000yqb.googlegroups.com> <87fxc9e0mg.fsf@nbi.dk> <4a76cd4f$0$31329$9b4e6d93@newsspool4.arcor-online.net> <87bpmxdqfo.fsf@nbi.dk> <2bae762e-0d8a-4389-843a-466e87f59fd1@a37g2000prf.googlegroups.com> <4a786b15$0$30230$9b4e6d93@newsspool1.arcor-online.net> <67e76046-62d4-4c0e-bdd8-8d00cdf93bca@l35g2000pra.googlegroups.com> <4a79f712$0$31874$9b4e6d93@newsspool3.arcor-online.net> <7a5aea9c-1ade-4d73-98ef-08d226823161@z31g2000yqd.googlegroups.com> In-Reply-To: <7a5aea9c-1ade-4d73-98ef-08d226823161@z31g2000yqd.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a7a0826$0$31862$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 06 Aug 2009 00:31:02 CEST NNTP-Posting-Host: bb83267e.newsspool3.arcor-online.net X-Trace: DXC=iY>KCNJ3kL\E47KDAk81NWMcF=Q^Z^V3X4Fo<]lROoRQ^YC2XCjHcbYXJ]ooN3Z`kRA:ho7QcPOVSOUijKh?@5:XQB5n0]7hK8_ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7615 Date: 2009-08-06T00:31:02+02:00 List-Id: Ludovic Brenta wrote: > Georg Bauhaus wrote on comp.lang.ada: >> + procedure Print (Item : String) is >> + Data : char_array renames To_C (Item & ASCII.LF); >> + begin >> + if fputs (Data'Address, stdout) < 0 then >> + raise Ada.IO_Exceptions.Device_Error; >> + end if; >> + end Print; > > I'm curious to know how the following performs: > > Stdout : constant Ada.Text_IO.Text_Streams.Stream_Access := > Ada.Text_IO.Text_Streams.Stream (Ada.Text_IO.Standard_Output); > > procedure Print (Item : String) is > begin > String'Write (Stdout, Item); > Character'Write (Stdout, ASCII.LF); > end Print; Terribly slow. Requesting only a tenth of the required amount (i.e. N = 2500000) has taken ~30s. By extrapolation the full set is produced only after ~5m. That's almost 20x slower than the original Ada.Text_IO. (The RM explains that String'Write calls procedure Character'Write for each component of the String...)