[BusyBox 0000758]: grep extremely slow

bugs at busybox.net bugs at busybox.net
Tue Feb 28 08:24:20 UTC 2006


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=758 
====================================================================== 
Reported By:                rfelker
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   758
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-28-2006 00:24 PST
Last Modified:              02-28-2006 00:24 PST
====================================================================== 
Summary:                    grep extremely slow
Description: 
time ./busybox grep a.*b ~/Mail/saved > /dev/null
real    0m19.583s
user    0m19.337s
sys     0m0.097s

time grep a.*b ~/Mail/saved > /dev/null
real    0m0.379s
user    0m0.283s
sys     0m0.083s

This is because the busybox version insists on recompiling the regex over
and over on each line. Fixing it is a matter of just calling regcomp once
and keeping the regex. It's trivial for the case of only one pattern, but
requires a tradeoff between memory and performance for the case of many
patterns.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-28-06 00:24  rfelker        New Issue                                    
02-28-06 00:24  rfelker        Status                   new => assigned     
02-28-06 00:24  rfelker        Assigned To               => BusyBox         
======================================================================




More information about the busybox-cvs mailing list