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

Submitter:  Johan Walles <walles>
Submitted:  Thu 22 May 2008 06:02:20 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by walles (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-23 bonzini StatusNone Fixed
        Open/ClosedOpen Closed
    2008-05-23 walles Attached File- Added grep-perf.txt, #15707
    2008-05-22 walles Attached File- Added fasterEpsclosure.patch, #15699

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code