Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Nice algorithm! The idea of using vectors never occured to me.

I went back and uncomment the print statements to see what kind of overhead the grep might cause. At N=100000 I end up with:

Benchmark: timing 100 iterations of Ase, Maverick... Ase: 142 wallclock secs (141.93 usr + 0.04 sys = 141.97 CPU) Maverick: 166 wallclock secs (166.05 usr + 0.00 sys = 166.05 CPU)
I would have expected us to end up with closer times, but your's ends up being 24 seconds faster? wow. So, I removed the prints and got:
Benchmark: timing 100 iterations of Ase, Maverick... Ase: 122 wallclock secs (121.11 usr + 0.00 sys = 121.11 CPU) Maverick: 164 wallclock secs (164.65 usr + 0.03 sys = 164.68 CPU)
I'm running this on a PII 400, using Red Hat Linux and the stock perl RPM (5.005_03). It would seem that vec is much faster under Linux than under windows.

Hmmm...I wonder how these benchmark out on other platforms...


In reply to RE: RE: sieve of Eratosthenes by maverick
in thread sieve of erothenes by maverick

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [Discipulus]: problematic? i came back after just a week of course, I forgo teverything..

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (8)
    As of 2017-12-18 11:24 GMT
    Find Nodes?
      Voting Booth?
      What programming language do you hate the most?

      Results (483 votes). Check out past polls.