Hi
das liegt nicht an der Version.
Ich habe mal die Zeilen gezählt und ab etwa 1000 Zeilen wird grep wirklich langsam.
Anhilfe:
ein "-F" hinter das Grep an den Stellen, die excludes verarbeiten (fast überall)
Da sind keine regex drin, müsste auch so laufen.
Kann das wer testen?
Nachtrag:
- Code: Select all
-F
Match using fixed strings. Treat each pattern specified as a string instead of a regular expression. If an input line contains any of the patterns as a contiguous sequence of bytes, the line will be matched. A null string matches every line.
Zeit kostet evtl. auch die Umcodierung von unicode auf widecha.
Es könnte evtl. auch mit dem verwendeten Zeichensatz (UTF-8) zusammen hängen(unicode)
"-P" würde dann Entlastung bringen...wenn wer ein grep hat, das das hat...oder man nimmt halt perl oder pcregrep
siehe
https://rg03.wordpress.com/2009/09/09/g ... -on-utf-8/Aber:
Ich sehe da keine RegEx, also müsste "-F" reichen.
Ein paar Messwerte unter debian:
- Code: Select all
> # tail -200 tmpExcludeList-ofc.txt > f
> # time grep -i -v -f f bla
ttt
real 0m1.074s
user 0m0.164s
sys 0m0.020s
- Code: Select all
# tail -500 tmpExcludeList-ofc.txt > f
# time grep -i -v -f f bla
ttt
real 0m12.987s
user 0m2.144s
sys 0m0.036s
- Code: Select all
# tail -1000 tmpExcludeList-ofc.txt > f
# time grep -i -v -f f bla
ttt
real 0m44.959s
user 0m7.684s
sys 0m0.028s
- Code: Select all
# tail -1200 tmpExcludeList-ofc.txt > f
# time grep -i -v -f f bla
ttt
real 1m22.078s
user 0m13.973s
sys 0m0.092s
Versuch abgebrochen. grep skaliert offenbar nicht! (Die Ecludeliste umfasst über 10000 Zeilen, getestet habe ich nur bis 1200..)
Gegenversuch mit "-F"
- Code: Select all
# tail -1200 tmpExcludeList-ofc.txt > f
#time grep -i -v -F -f f bla
ttt
real 0m0.538s
user 0m0.080s
sys 0m0.012s
Und 10000 Zeilen(dauert sonst Stunden):
- Code: Select all
# time grep -i -v -F -f tmpExcludeList-ofc.txt bla
ttt
real 0m7.531s
user 0m1.192s
sys 0m0.068s
# grep --version
GNU grep 2.6.3