comp.lang.ada
 help / color / mirror / Atom feed
From: Fionn Mac Cumhaill <invisible@hiding.from.spam>
Subject: Re: Reading and writing a big file in Ada (GNAT) on Windows XP
Date: Thu, 03 May 2007 06:31:49 GMT
Date: 2007-05-03T06:31:49+00:00	[thread overview]
Message-ID: <aavi33t9mu7fbv1mt5ovsuec860t00dpsd@4ax.com> (raw)
In-Reply-To: 1178091967.392381.282510@o5g2000hsb.googlegroups.com

On 2 May 2007 00:46:07 -0700, george@gentoo.org wrote:

>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.
>Looks like a perfect task for sed utility to me. Even if sed does not
>do all you need you can at the very least check some simple sed
>transformation on your data, which should give you an estimate of what
>run times you can expect with your file.
>I am not familiar with MinGW environment. If it is anything like
>CygWin then you should be able to run GNU tools and perform that test
>with sed. At least this should answer the
>
>> Do I have an Ada problem, a GNAT problem, or a MinGW problem?
>
>(and CygWin does tend to be slower than native computation, however I
>used it only a few times).
>
>
>George
I considered sed, but I know next to nothing about it, and decided
that by the time I learned enough to use it, I could have done the job
in Ada several times over.

I did do further investigation; I made a copy of the now-working
program and threw most of the program away, leaving only a very simple
program which read the large input file, but made no changes and did
no output. I added code to track the run time and put the buffer clear
back in. It read the 10 million lines in just a little over five
minutes. I then put  Index back and used it to search the buffer for a
short string that would never be found, seatching forwards from the
beginning of the input buffer. Bingo. Run time increased to a bit more
than 1-1/2 hours. 

One of the earlier commenters observed that there was a bug in GNAT's
Index. It will be interesting to try this again once the bug is fixed.



  reply	other threads:[~2007-05-03  6:31 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28  5:03 Reading and writing a big file in Ada (GNAT) on Windows XP Fionn Mac Cumhaill
2007-04-28  5:20 ` Gautier
2007-04-29 21:17   ` Fionn Mac Cumhaill
2007-04-28  5:25 ` tmoran
2007-04-28  6:56 ` Martin Krischik
2007-04-28 17:12   ` tmoran
2007-04-28 12:41 ` Jeffrey Creem
2007-04-29 21:35   ` Fionn Mac Cumhaill
2007-04-28 13:22 ` (see below)
2007-04-28 17:56 ` Simon Wright
2007-04-28 18:28   ` Jeffrey Creem
2007-04-29  7:20     ` Simon Wright
2007-04-29 21:44     ` Fionn Mac Cumhaill
2007-04-29 21:42   ` Fionn Mac Cumhaill
2007-04-30  0:48     ` Jeffrey R. Carter
2007-04-30  2:30       ` Fionn Mac Cumhaill
2007-04-30  4:21         ` tmoran
2007-04-28 19:12 ` Jeffrey R. Carter
2007-04-29 21:46   ` Fionn Mac Cumhaill
2007-05-01 14:10     ` Fionn Mac Cumhaill
2007-05-06 21:55     ` Quarc
2007-05-02  7:46 ` george
2007-05-03  6:31   ` Fionn Mac Cumhaill [this message]
2007-05-03 20:00     ` Simon Wright
2007-05-04  4:35       ` Jeffrey R. Carter
2007-05-04  4:45       ` Fionn Mac Cumhaill
2007-05-04  6:53       ` Alternative Index implementation? (Was: Reading and writing a big file in Ada (GNAT) on Windows XP) Jacob Sparre Andersen
2007-05-04  7:41         ` Dmitry A. Kazakov
2007-05-04  9:16           ` Copying string slices before calling subroutines? (Was: Alternative Index implementation?) Jacob Sparre Andersen
2007-05-04  9:44             ` Copying string slices before calling subroutines? Jacob Sparre Andersen
2007-05-04 10:14               ` Dmitry A. Kazakov
2007-05-04 12:07                 ` Jeffrey Creem
2007-05-04 12:46                   ` Dmitry A. Kazakov
2007-05-04 22:27                   ` Simon Wright
2007-05-05  7:33                     ` Jacob Sparre Andersen
2007-05-05  7:47                       ` Dmitry A. Kazakov
2007-05-05  7:41                     ` Dmitry A. Kazakov
2007-05-03 20:27     ` Reading and writing a big file in Ada (GNAT) on Windows XP Adam Beneschan
2007-05-03 23:01       ` Randy Brukardt
2007-05-04  0:28         ` Markus E Leypold
2007-05-05 16:26           ` Adam Beneschan
2007-05-05 17:27             ` Markus E Leypold
2007-05-15 23:03               ` Randy Brukardt
2007-05-04 20:04         ` Adam Beneschan
2007-05-05 16:36           ` tmoran
replies disabled

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