9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan9port tools speed
@ 2009-07-24  8:36 Lorenzo Bolla
  2009-07-24  9:08 ` Francisco J Ballesteros
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Lorenzo Bolla @ 2009-07-24  8:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

Hi all,

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.

Moreover, the executables in plan9/bin are bigger. Again, plan9's 'grep' is
40% bigger:
$ ll /bin/grep /usr/local/plan9/bin/grep
-rwxr-xr-x 1 root root 100500 2009-03-28 22:06 /bin/grep
-rwxr-xr-x 1 root root 141512 2009-07-24 09:06 /usr/local/plan9/bin/grep

Is it expected? Why? Should I re-compile the plan9port with some
optimization switches? How?

Thanks!
L.

[-- Attachment #2: Type: text/html, Size: 846 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24  8:36 [9fans] plan9port tools speed Lorenzo Bolla
@ 2009-07-24  9:08 ` Francisco J Ballesteros
  2009-07-24 10:11   ` Rodolfo (kix)
  2009-07-24 10:17 ` Uriel
  2009-07-24 13:41 ` erik quanstrom
  2 siblings, 1 reply; 9+ messages in thread
From: Francisco J Ballesteros @ 2009-07-24  9:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Think about shared libraries in linux.

>
> Moreover, the executables in plan9/bin are bigger. Again, plan9's 'grep' is
> 40% bigger:



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24  9:08 ` Francisco J Ballesteros
@ 2009-07-24 10:11   ` Rodolfo (kix)
  2009-07-24 10:38     ` Lorenzo Bolla
  0 siblings, 1 reply; 9+ messages in thread
From: Rodolfo (kix) @ 2009-07-24 10:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

The files are stripped?

try "file /usr/local/plan9/bin/grep"

if is non-stripped, try with "strip /usr/local/plan9/bin/grep"



On Fri, Jul 24, 2009 at 11:08 AM, Francisco J Ballesteros<nemo@lsub.org> wrote:
> Think about shared libraries in linux.
>
>>
>> Moreover, the executables in plan9/bin are bigger. Again, plan9's 'grep' is
>> 40% bigger:
>
>



-- 
Rodolfo García "kix"
EA4ERH - IN80ER



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24  8:36 [9fans] plan9port tools speed Lorenzo Bolla
  2009-07-24  9:08 ` Francisco J Ballesteros
@ 2009-07-24 10:17 ` Uriel
  2009-07-24 10:42   ` Lorenzo Bolla
  2009-07-24 13:41 ` erik quanstrom
  2 siblings, 1 reply; 9+ messages in thread
From: Uriel @ 2009-07-24 10:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

My bet is on file system performance. Where did the data come from?

9vx is also much faster, even if binaries are identical, because
fossil is such a dog.

uriel

P.S.: In my experience with werc ( http://werc.cat-v.org ) statically
linking p9p tools further increases performance considerably, p9p
tools are also insanely faster than gnu tools.

On Fri, Jul 24, 2009 at 10:36 AM, Lorenzo Bolla<lbolla@gmail.com> wrote:
> Hi all,
>
> 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.
>
> Moreover, the executables in plan9/bin are bigger. Again, plan9's 'grep' is
> 40% bigger:
> $ ll /bin/grep /usr/local/plan9/bin/grep
> -rwxr-xr-x 1 root root 100500 2009-03-28 22:06 /bin/grep
> -rwxr-xr-x 1 root root 141512 2009-07-24 09:06 /usr/local/plan9/bin/grep
>
> Is it expected? Why? Should I re-compile the plan9port with some
> optimization switches? How?
>
> Thanks!
> L.
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24 10:11   ` Rodolfo (kix)
@ 2009-07-24 10:38     ` Lorenzo Bolla
  0 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Bolla @ 2009-07-24 10:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On Fri, Jul 24, 2009 at 11:11 AM, Rodolfo (kix) <kix@kix.es> wrote:

> The files are stripped?
>
> try "file /usr/local/plan9/bin/grep"
>
> if is non-stripped, try with "strip /usr/local/plan9/bin/grep"


Indeed, now plan9's grep is 1/2 the size of gnu's.
thanks!
L.


>
>
>
>
> On Fri, Jul 24, 2009 at 11:08 AM, Francisco J Ballesteros<nemo@lsub.org>
> wrote:
> > Think about shared libraries in linux.
> >
> >>
> >> Moreover, the executables in plan9/bin are bigger. Again, plan9's 'grep'
> is
> >> 40% bigger:
> >
> >
>
>
>
> --
> Rodolfo García "kix"
> EA4ERH - IN80ER
>
>

[-- Attachment #2: Type: text/html, Size: 1262 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24 10:17 ` Uriel
@ 2009-07-24 10:42   ` Lorenzo Bolla
  0 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Bolla @ 2009-07-24 10:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

On Fri, Jul 24, 2009 at 11:17 AM, Uriel <uriel99@gmail.com> wrote:

> My bet is on file system performance. Where did the data come from?


It's a disc file. But does it make a difference, as the file system (ext3)
is common to both "grep"s?
L.

[-- Attachment #2: Type: text/html, Size: 536 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24  8:36 [9fans] plan9port tools speed Lorenzo Bolla
  2009-07-24  9:08 ` Francisco J Ballesteros
  2009-07-24 10:17 ` Uriel
@ 2009-07-24 13:41 ` erik quanstrom
  2009-07-25  9:30   ` Ethan Grammatikidis
  2 siblings, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2009-07-24 13:41 UTC (permalink / raw)
  To: 9fans

> 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-24 13:41 ` erik quanstrom
@ 2009-07-25  9:30   ` Ethan Grammatikidis
  2009-07-25 13:40     ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: Ethan Grammatikidis @ 2009-07-25  9:30 UTC (permalink / raw)
  To: 9fans

On Fri, 24 Jul 2009 09:41:41 -0400
erik quanstrom <quanstro@quanstro.net> wrote:

> > 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
>

Try LC_ALL=en_GB.UTF-8 for some wierd, wierd fun with gnu grep:

 $ wc -l deep-file-list
470485 deep-file-list

 $ 9 grep ethan deep-file-list |wc -l
428065

 $ time grep ethan deep-file-list > /dev/null

real	4m29.491s
user	4m29.366s
sys	0m0.080s

 $ time grep -F ethan deep-file-list > /dev/null

real	4m27.740s
user	4m27.576s
sys	0m0.070s

 $ time awk '/ethan/ {print}' deep-file-list > /dev/null

real	0m2.597s
user	0m2.570s
sys	0m0.017s

 $ time sed -n /ethan/p deep-file-list > /dev/null

real	0m0.294s
user	0m0.273s
sys	0m0.020s

 $ time 9 grep ethan deep-file-list > /dev/null

real	0m0.155s
user	0m0.140s
sys	0m0.017s


Note fixed pattern and discarded output. Those are fairly average
timings. They rank gnu grep at 1700 times slower than unstripped p9p
grep. :) Note that awk and sed there are gnu awk and sed, and both are
operating under the same LC_ALL=en_GB.UTF-8 environment. Gnu sed comes
in at 900 times faster than gnu grep, and awk at 100 times.

I took some more timings after some correspondance with
bug-grep@gnu.org. I do recall gnu grep was twice as fast as p9p grep
when given a plain ascii environment, but I haven't kept other results.

I don't know if the gnu grep maintainers are looking for a fix, or even
if they consider this extreme slowness a problem at all. It didn't sound
like it when I corresponded with them, but I guess that could simply
mean they didn't want to discuss it.


--
Ethan Grammatikidis

Those who are slower at parsing information must
necessarily be faster at problem-solving.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] plan9port tools speed
  2009-07-25  9:30   ` Ethan Grammatikidis
@ 2009-07-25 13:40     ` erik quanstrom
  0 siblings, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2009-07-25 13:40 UTC (permalink / raw)
  To: 9fans

> I took some more timings after some correspondance with
> bug-grep@gnu.org. I do recall gnu grep was twice as fast as p9p grep
> when given a plain ascii environment, but I haven't kept other results.
>
> I don't know if the gnu grep maintainers are looking for a fix, or even
> if they consider this extreme slowness a problem at all. It didn't sound
> like it when I corresponded with them, but I guess that could simply
> mean they didn't want to discuss it.

i went so far as to send a patch.  it was ignored.

- erik



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-25 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24  8:36 [9fans] plan9port tools speed Lorenzo Bolla
2009-07-24  9:08 ` Francisco J Ballesteros
2009-07-24 10:11   ` Rodolfo (kix)
2009-07-24 10:38     ` Lorenzo Bolla
2009-07-24 10:17 ` Uriel
2009-07-24 10:42   ` Lorenzo Bolla
2009-07-24 13:41 ` erik quanstrom
2009-07-25  9:30   ` Ethan Grammatikidis
2009-07-25 13:40     ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).