[BusyBox 0000758]: grep extremely slow

bugs at busybox.net bugs at busybox.net
Thu Mar 9 22:25:31 UTC 2006


The following issue has been CLOSED 
====================================================================== 
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:                     closed
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             02-28-2006 00:24 PST
Last Modified:              03-09-2006 14:25 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.
====================================================================== 

---------------------------------------------------------------------- 
 vodz - 02-28-06 02:11  
---------------------------------------------------------------------- 
Ok.
See 14361 SVN revision. 

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         
02-28-06 02:11  vodz           Note Added: 0001146                          
02-28-06 02:11  vodz           Status                   assigned => resolved
02-28-06 02:11  vodz           Resolution               open => fixed       
03-09-06 14:25  landley        Status                   resolved => closed  
======================================================================




More information about the busybox-cvs mailing list