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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c19e8df8a75221d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!d23g2000vbm.googlegroups.com!not-for-mail From: jonathan Newsgroups: comp.lang.ada Subject: Re: Q: Line_IO Date: Tue, 1 Sep 2009 05:03:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <171e3dd8-ed84-4591-96b4-0514fa6e2c00@d23g2000vbm.googlegroups.com> References: <4a9b045a$0$31875$9b4e6d93@newsspool3.arcor-online.net> <1a4usf20z4mxa.1vct95fmrcs6h.dlg@40tude.net> <4a9c6320$0$31347$9b4e6d93@newsspool4.arcor-online.net> <56e70160-3e24-4bd0-be49-99999c191522@e34g2000vbm.googlegroups.com> NNTP-Posting-Host: 143.117.23.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1251806644 16412 127.0.0.1 (1 Sep 2009 12:04:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Sep 2009 12:04:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d23g2000vbm.googlegroups.com; posting-host=143.117.23.233; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.13) Gecko/2009082120 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8098 Date: 2009-09-01T05:03:34-07:00 List-Id: On Sep 1, 8:02=A0am, Ludovic Brenta wrote: > Georg Bauhaus wrote on comp.lang.ada: > > > =A0 =A0BUFSIZ: constant :=3D 8_192; > [...] > > =A0 =A0SL : constant Natural :=3D Separator_Sequence'Length; > > =A0 =A0subtype Extended_Buffer_Index is Positive range 1 .. BUFSIZ + SL= ; > > Since BUFSIZ is obviously chosen as an integral number of hardware > memory pages, the extended_buffer uses two pages plus two bytes. How > about allocating a buffer of BUFSIZ bytes and using only BUFSIZ-SL for > the string and the remaining SL bytes for the terminator? > > I realize that at this point we're down to nitpicking because the > program seems really good and fast now. > > -- > Ludovic Brenta. A few benchmark timings: I updated a version of knucleotide.adb with the new get_line. IO overhead fell from 3.6 sec on my machine, to 1.2 sec. It now reads and stores (half of) the 250 MB text file in about the same time as my vim editor. Very nice result, especially for the multitasking program, which can parallelize everything except IO. Jonathan