buggrep - Bugs: bug #23321, Epsclosure speedup patch

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #23321: Epsclosure speedup patch

Submitted by:  Johan Walles <walles>
Submitted on:  Thu 22 May 2008 06:02:20 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 23 Dec 2009 04:32:12 PM UTC, comment #2:

Patch applied, thanks.

Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paolo Bonzini <bonzini>
Fri 23 May 2008 05:37:38 AM UTC, comment #1:

The just attached file shows grep benchmark results. I got the patterns file by doing:

cat /etc/logcheck/ignore.d.workstation > /tmp/ignore

The numbers show the startup time for grep with about 2500 regexps read from a file (logcheck does this every hour) is:
Plain 2.5.3 : 68.0s
CALLOC patch : 24.2s
int->char patch: 5.8s

Adding 10000 lines of input (my /var/log/daemon.0 log file) doesn't change the numbers much:
Plain 2.5.3 : 70.4s

Both CALLOC and
int->char patch: 5.7s

Johan Walles <walles>
Thu 22 May 2008 06:02:20 PM UTC, original submission:

Hi!

My system frequently spends 20% CPU time on clearing memory in grep's epsclosure() function (*).

The memory area being cleared (it's called "visited") consists of ints, that are used to store values 0 and 1.

Replacing the ints with chars makes the memory area to clear one quarter of the size. Which obviously makes the memset() operation go four times as fast.

Please apply the attached patch (it's relative to 2.5.3). In the development branch simply changing the visited declaration and the CALLOC call is enough.

Regards //Johan

(*) http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450649

Johan Walles <walles>

 

Attached Files
file #15707:  grep-perf.txt added by walles (909B - text/plain - Benchmarking results)
file #15699:  fasterEpsclosure.patch added by walles (555B - text/x-diff - epsclosure() speedup patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  • -unavailable- added by walles (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Dec 2009 04:32:12 PM UTCbonziniStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 23 May 2008 05:28:29 AM UTCwallesAttached File-=>Added grep-perf.txt, #15707
    Thu 22 May 2008 06:02:20 PM UTCwallesAttached File-=>Added fasterEpsclosure.patch, #15699

    Back to the top


    Powered by Savane 3.1-cleanup1