Hi Chromatic. If I understand you correctly, you are saying that an optimization like  my $i if 0 occurs in this code. I suppose you mean that some construct will infer a runtime penalty (as opposed to compile-time penalty). Just a bit puzzled, would you care to explain a bit more?

Personally I don't like  my $i if 0; (I would even call it "dangerous" in the sense of not {truly} maintainable) as I prefer the idiom of true shared variables  { my $shared; sub f1 { ... # use $shared } sub f2 {...} }

In any case I fail to see some optimization kicking in on cygwin. How much faster is the second run on your system? aren't my-allocations very fast with respect to a foreach loop anyway? again seems that all "my slots" will be reserved at compile-time, no?

The only thing I see is that could be flagged as non-pbp is the construct  my $region; for $region {...} that can be transformed into for my ... for recent enough perl (I wonder what is the best way to handle all versions of perl though...).

cheers --stephan

In reply to Re^2: Garbage collection problem?? by sgt
in thread Garbage collection problem?? by tcarmeli

Title:
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, details, 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, summary, 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.