![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re^12: Finding All Paths From a Graph From a Given Source and End Nodeby BrowserUk (Pope) |
on Nov 02, 2010 at 19:43 UTC ( #869076=note: print w/replies, xml ) | Need Help?? |
Simply avoiding the array-copy my @path=@_ makes a factor 4.5 performance boost... Wow. I'm amazed that avoiding the copying of such a small array had such a dramatic affect on the performance. I guess it must be being copied very many times. In mine, I tried building the hash from the array rather than carrying it around, and it produced an ~8% speed-up. Then I tried using $_[n] instead of named parameters and it leached less than 5% more. The first is worth having, the second not:
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|