buggrep - Bugs: bug #38594, Poor grep performance for long...

 
 

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

bug #38594: Poor grep performance for long regexp compared to performance with -P option

Submitted by:  Jaroslav ┼ákarvada <yarda>
Submitted on:  Tue 26 Mar 2013 07:46:55 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Tue 26 Mar 2013 07:46:55 AM UTC, original submission:

This was originally reported in:
http://bugzilla.redhat.com/show_bug.cgi?id=875131

There's huge gap between performance of grep and grep -P for certain regular expressions.

Steps to Reproduce:
1.

PATTERN="^....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 00000000000"

INPUTLINE=".................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 00000000000"

for i in `seq -w 1 10000`; do echo ${i}${INPUTLINE}${i} >> /tmp/input ;done

2. time grep -P -v "$PATTERN" /tmp/input
3. time grep -v "$PATTERN" /tmp/input
4. time grep -v "^.\{1143\} 0\{11\}" /tmp/input
5. time grep -P -v "^.{1143} 0{11}" /tmp/input
4. export LANG=C
5. repeat 2., 3.
6. export LANG=en_US.iso88591
7. repeat 2., 3.

Actual results:

grep -P is 300-7000x faster than without -P option (for all combinations of LANG and usage of $PATTERN or "^.\{1143\} 0\{11\}", resp. "^.{1143} 0{11}" with -P).

Expected results:

performance of grep is comparable when using the same pattern.

Jaroslav Škarvada <yarda>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by yarda (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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup