bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sed-4.0 seven times slower than sed 3


From: Bruno Haible
Subject: sed-4.0 seven times slower than sed 3
Date: Thu, 14 Nov 2002 16:14:20 +0100 (CET)

Hi,

Here is a case where sed-4.0 is more than 7 times slower than sed-3.02.80.

$ sed -e 's,^\([0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]*\);\([^;]*\);.*$,0x\1 # 
\2,' < $UNICODEDATA > /dev/null

where $UNICODEDATA is an large text file (get it from
http://www.haible.de/bruno/UnicodeData.txt.bz2 )

With sed-3.02.80 I get a run time of  4.5 sec.
With sed-4.0     I get a run time of 32.8 sec.

These timings are independent whether the locale is "C" or "de_DE.UTF-8".
Platform is Linux/x86 with glibc 2.3.

Note that sed 4.0 uses its own regcomp and regexec, not the ones from glibc.
$ nm `which sed`| grep ' reg'
0804ea20 T regcomp
0804eb40 T regerror
0805a7e8 b regex_last.0
08051d90 T regexec
0804ebb0 T regfree
08057180 t register_state

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]