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!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: Reading and writing a big file in Ada (GNAT) on Windows XP Date: Sat, 28 Apr 2007 14:22:36 +0100 Message-ID: References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net zJ4TGS9u+hvD5stPzj+kiQ6TNxPxtq3MwB2GXKNWZTYFi7TSYl User-Agent: Microsoft-Entourage/11.3.3.061214 Thread-Topic: Reading and writing a big file in Ada (GNAT) on Windows XP Thread-Index: AceJmEk7h+qstPWLEduiyQARJIjQTg== Xref: g2news1.google.com comp.lang.ada:15378 Date: 2007-04-28T14:22:36+01:00 List-Id: On 28/4/07 06:03, in article 0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com, "Fionn Mac Cumhaill" wrote: > I have written a very simple program that runs on a Windows XP > machine. (Pentium D , I don't remember the clock speed, it is in > middle of Pentium D clock speeds, 2 Gb memory) It is compiled with the > MinGW GNAT 3.4.5 Ada compiler. > > 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. ... > The problem is that the input file has more than 10 million lines of > text in it. The program works perfectly, but takes about 5 hours to > run. The Cygwin version of wc can count the lines in the input file in > less than one minute. I have an assembler that reads source code and writes an equal number of lines of object code, all I/O done using Ada.Text_IO.{Get_Line, Put(str)}. That takes less than 6 sec CPU time, on a Mac Powerbook 1.67GHz laptop, for 1_000_000 lines of input, giving a performance of around 10 million lines per minute - around 300 times faster than you are getting - so I think it unlikely that Ada.Text_IO is your problem. -- Bill Findlay chez blueyonder.co.uk