9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@coraid.com>
To: pietro10@mac.com, 9fans@9fans.net
Subject: Re: [9fans] Fun with libthread 1: The Sieve
Date: Fri,  6 Jun 2008 15:28:34 -0400	[thread overview]
Message-ID: <b55d32debf66ecf9efaae6d4bb8b50ae@coraid.com> (raw)
In-Reply-To: <8F4B8613-A488-4456-8F4D-D6B71A2EADD5@mac.com>

> The program spawns n + 2 threads. sieve and counter are only spawned
> once, but filter is spawned for every prime number.
>
> With Roger's command line, primes took me about 91 seconds - possibly
> because it isn't looking for a specific end. primes 1 2837711 takes 43
> seconds.
>

perhaps roger is using a different version of primes.  the version
on sources finds all the primes before any are printed.  the output
is not buffered so that may also contribute quite a bit to the run
time.  (hence 1.25s of system time.)

	; time rc -c 'primes 1 10000000000 | sed 205963q | tail -5'
	2837629
	2837633
	2837677
	2837693
	2837711
	3.64u 1.25s 4.29r 	 rc -c primes 1 10000000000 | sed 205963q | tail -5  # status= rc 42288: primes 42289: sys: write on closed pipe pc=0x00005ef5||

i would imagine that pietro is running in an emulator to be 20x
slower.

but all this performance stuff misses the point.

- erik



  reply	other threads:[~2008-06-06 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  3:09 Pietro Gagliardi
2008-06-06  9:55 ` Martin Neubauer
2008-06-06 10:19   ` roger peppe
2008-06-06 10:23   ` Pietro Gagliardi
2008-06-06 11:29     ` Martin Neubauer
2008-06-06 14:00 ` roland.kaufmann
2008-06-06 19:02   ` Pietro Gagliardi
2008-06-06 19:28     ` erik quanstrom [this message]
2008-06-06 15:35 ` Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b55d32debf66ecf9efaae6d4bb8b50ae@coraid.com \
    --to=quanstro@coraid.com \
    --cc=9fans@9fans.net \
    --cc=pietro10@mac.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).