comp.lang.ada
 help / color / mirror / Atom feed
From: jonathan <johnscpg@googlemail.com>
Subject: Re: Q: Line_IO
Date: Tue, 1 Sep 2009 05:03:34 -0700 (PDT)
Date: 2009-09-01T05:03:34-07:00	[thread overview]
Message-ID: <171e3dd8-ed84-4591-96b4-0514fa6e2c00@d23g2000vbm.googlegroups.com> (raw)
In-Reply-To: 56e70160-3e24-4bd0-be49-99999c191522@e34g2000vbm.googlegroups.com

On Sep 1, 8:02 am, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
> Georg Bauhaus wrote on comp.lang.ada:
>
> >    BUFSIZ: constant := 8_192;
> [...]
> >    SL : constant Natural := Separator_Sequence'Length;
> >    subtype 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




  parent reply	other threads:[~2009-09-01 12:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4a9b045a$0$31875$9b4e6d93@newsspool3.arcor-online.net>
2009-08-31  8:28 ` Q: Line_IO Martin
2009-08-31 10:05   ` Georg Bauhaus
2009-08-31 15:33     ` Anh Vo
2009-08-31 16:52       ` Georg Bauhaus
2009-08-31 18:39 ` Dmitry A. Kazakov
2009-08-31 22:51   ` Robert A Duff
2009-09-01  0:35     ` Georg Bauhaus
2009-08-31 23:56   ` Georg Bauhaus
2009-09-01  0:19     ` Georg Bauhaus
2009-09-01  1:08       ` Robert A Duff
2009-09-01  7:02     ` Ludovic Brenta
2009-09-01  9:55       ` Georg Bauhaus
2009-09-01 12:03       ` jonathan [this message]
     [not found]       ` <4a9e2c86$0$30235$9b4e6d93@newsspool1.arcor-online.net>
2009-09-02  8:47         ` Georg Bauhaus
2009-09-05 20:30       ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox