> I've just installed the plan9port as described here (
> http://swtch.com/plan9port/man/man1/install.html) on a debian box.
> I was comparing the speed of some commands between the plan9 and the GNU
> version, and I get consistently poorer results for the plan9 ones.
> 'grep' for example, is at least twice as slow as its GNU counterpart.
on my 64-bit system grepping through linux
source, i do see the same performance difference
you see.
; pwd ; which grep
/usr/src/linux-2.6.29-gentoo-r5
/home/quanstro/plan9/bin/grep
; for(f in grep /bin/grep)find .|grep '\.[ch]'|
xargs time $f -i 'plan[ ]*9'>/dev/null|[2]
awk '{a+=$1; b+=$2; c+=$3} END {print a "\t" b "\t"c}'
1.08 0.24 1.36
0.46 0.31 0.79
but this is not a fair comparison. gnu
grep should be using ascii since none of
the local env variables have been set while
p9p grep is using utf-8. let's level the playing
field:
; ; LANG=en_US.UTF-8 for(f in grep /bin/grep)find .|
grep '\.[ch]'|xargs time $f -i 'plan[ ]*9'>/dev/null|[2]
awk '{a+=$1; b+=$2; c+=$3} END {print a "\t" b "\t"c}'
1.07 0.25 1.37
17.13 0.28 17.43
this is actually a great improvement. gnu grep used to
be 80x slower for utf-8 locales, now it's only 40x slower.
- erik