Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Good one, man. my $i does speed it up, now the ratio become perl:java:c = 27:7:5.

But use integer does not seem to affect the result, and it should not affect the result on a 32 bit machine, when integers are less than 10^6.

I also tried 0..1,000,000 as one post suggested, it slows down the whole thing.

I then became interested in the difference between your benchmark and my result. (I didn't suspect you cook the numbers and I don't, never, just as you should not suspect me.) So I ran your benchmark testing, and got:
Benchmark: timing 5 iterations of int_iterate, iterate, lex_iterate... int_iterate: 131 wallclock secs (130.94 usr + 0.00 sys = 130.94 CPU) +@ 0.04/s (n=5) iterate: 172 wallclock secs (172.63 usr + 0.00 sys = 172.63 CPU) @ + 0.03/s ( n=5) lex_iterate: 137 wallclock secs (136.66 usr + 0.00 sys = 136.66 CPU) +@ 0.04/s (n=5) s/iter iterate lex_iterate int_iterate iterate 34.5 -- -21% -24% lex_iterate 27.3 26% -- -4% int_iterate 26.2 32% 4% --
I would believe this is due to my small mem config as I said in another reply.

But your data shows use integer speeds up the thing a lot, that part really confuses me. I don't think you are using 16 bit OS though. Did you compiled your perl yourself?

In reply to Re: Re(2): Lesson Taught by Anonymous Monk
in thread Teach him a lesson with facts by Anonymous Monk

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
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (4)
    As of 2018-11-15 06:48 GMT
    Find Nodes?
      Voting Booth?
      My code is most likely broken because:

      Results (181 votes). Check out past polls.