This is the mail archive of the
gnats-devel@sources.redhat.com
mailing list for the GNATS project.
Re: fix for PR 219 - large PRs or updates take many minutes to process
- To: "Dirk Bergstrom" <dirk at juniper dot net>
- Subject: Re: fix for PR 219 - large PRs or updates take many minutes to process
- From: Milan Zamazal <pdm at zamazal dot org>
- Date: 30 Jul 2001 13:33:39 +0200
- Cc: <gnats-devel at sources dot redhat dot com>
- References: <C0D6C1C24CDBE1449BFEF1B72AFBF3A709A5AD3E@postal.jnpr.net>
>>>>> "DB" == Dirk Bergstrom <dirk@juniper.net> writes:
DB> 1) read sizeof(line)-1 chars from the message (<=1024 chars),
DB> instead of sizeof(buf)-1 chars (2 chars).
DB> 2) add code to keep track of buf's length in a variable, instead
DB> of doing a strlen(buf) for every loop iteration.
DB> the first fix gives a 20-30x improvement (from hours to minutes)
DB> for a 1.4 MB testcase. the second fix gave a 50x improvement
DB> (five minutes to
>> 10 seconds) for the same testcase.
DB> and some cleanup:
DB> xrealloc()ing buf in 4K chunks only when needed, instead of
DB> every loop iteration. doesn't seem to change speed, but it
DB> feels better...
Thanks, Dirk, this is a very useful work! I applied the patch with
minor changes.
Regards,
Milan Zamazal
--
Wasting somebody else's time strikes me as the height of rudeness.
Bill Gates