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!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 28 Apr 2007 14:15:03 -0500 Date: Sat, 28 Apr 2007 14:28:56 -0400 From: Jeffrey Creem User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Reading and writing a big file in Ada (GNAT) on Windows XP References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-Du8IoPAfGb3MDsdnV3F4DHzNBBJv8hlEylGf5hUQ125VoN7bTtEMOedWkuXQGVnVqZhais0Kp/pJiPO!dqeFYTKtwJJUUmGyTy0zhzztG5gXiKY2/X/yZUgea8wUvTuuEQHZ9xqQ/mwKh9xoSsbS5M4ARHL0!jxr6nD8wNVFR9kRHBkQLTA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Xref: g2news1.google.com comp.lang.ada:15389 Date: 2007-04-28T14:28:56-04:00 List-Id: Simon Wright wrote: > Fionn Mac Cumhaill writes: > >> The modifications consist of replacing a slice of text at the end of >> a line with another bit of text. The biggest slice is 10 characters, >> and the replacement slice is always smaller than the original >> slice. An occasional line of text is about 6000 characters long, but >> most are about 700 haracters. Get_Line reads them into a String >> variable that is 10,000 characters long. > > Yesterday I found a performance (and stack!) related problem in GNAT's > Ada.Strings.Fixed.Index. The string is mapped onto the stack before > the search is done. But I wouldn't have thought this would result in a > 5 hour run time. How do you decide which lines need conversion? I agree, it does not seem that either that or the guesses I had related to zeroing at the string (a common mistake) would result in the level of slowdown being seen...However, now that you mention it, I see a few ugly things like that related to Ada.Strings.Fixed. Did you submit a bug report to FSF GCC? As for the original poster, any chance you are doing dynamic memory allocation and leaking and perhaps causing swapping?