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
|