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: a07f3367d7,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!transit4.hitnews.eu!xlned.com!feeder3.xlned.com!news2.euro.net!newsfeed.freenet.de!news.tu-darmstadt.de!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 03 Aug 2009 13:43:11 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.22 (Macintosh/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> In-Reply-To: <87fxc9e0mg.fsf@nbi.dk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a76cd4f$0$31329$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 03 Aug 2009 13:43:12 CEST NNTP-Posting-Host: b7441caa.newsspool4.arcor-online.net X-Trace: DXC=TG?lZ`PL4N2kUFX=Y?aLP;4IUK Jacob Sparre Andersen schrieb: > Ludovic Brenta wrote: > >> I note that both Martin and yourself use Ada.Text_IO (especially >> Read_Line) which is notoriously slow. I would use Character'Read >> and a finite state machine to detect the portion of the input file >> to be processed, then to fill in the buffer. That should be faster. Some tests require that all lines are read, and kept. > Wouldn't it be even faster to map the data file to a string (using > POSIX.Memory_Mapping.Map_Memory), and then "read" from that string? According to the FAQ, "programs are expected to either take a single command-line parameter or read text from stdin." "Each program was run as a child-process of a Python script using Popen" There also is a "preference for plain vanilla programs". (E.g., the pidigits description permits using the GMP library, as an exception, I think.) It seems, then, that Ada has not the best built in support for programs that should quickly read and write lines of chars from and into pipes, respectively. > I have a ready-to-use package and demonstration procedure for this > purpose on , if somebody > is interested. > > Greetings, > > Jacob