This is the mail archive of the gnats-devel@sources.redhat.com mailing list for the GNATS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fix for PR 219 - large PRs or updates take many minutes to process


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]