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,4fbd260da735f6f4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <1730404.gacr4ERdag@linux1.krischik.com> From: Martin Krischik Subject: Re: Reading and writing a big file in Ada (GNAT) on Windows XP Newsgroups: comp.lang.ada Date: Sat, 28 Apr 2007 08:56:56 +0200 References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 84.73.230.248 (84.73.230.248) NNTP-Posting-Date: Sat, 28 Apr 2007 09:30:03 +0200 X-Trace: 27f8a4632f7fbf1ec435d24556 Xref: g2news1.google.com comp.lang.ada:15373 Date: 2007-04-28T08:56:56+02:00 List-Id: Fionn Mac Cumhaill wrote: > All it does is read lines in a loop from a text file with > Ada.Text_IO.Get_Line, does minor modifications on about 80% of the > lines that it reads, and writes the lines to an output file with > Put_Line. I wrote something like as well. Only I did it genericly as part of the AdaCL [1] library. It could be extended to solve your problem. Now, what I did was to create pipline with three threads - one to read the line, one to make the change, and one to write the lines. Each step of the pipline where connected with a fifo buffer. The idea was that while the system is waiting for new data from the disk it could convert an few lines from the buffer. When I wrote it I use SCSI drives so I could expect better performance from such a setup. But you might still give it a try. I used used pretty modest buffering - in your case I would go for bigger buffers. Martin [1] http://adacl.sf.net -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com