> 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