Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If you accept the principle that code in modules is destined to be reused in lots of situations, including performance critical ones, and should therefore do it's utmost to be as efficient as the author is comfortable maintaining, then List::Util's use of aliasing to sqeeze a little more performance seems entirely reasonable. That said, they missed a trick. Using a block form map creates a additional level of scope that they aren't using and slows performance. They can squeeze another 30%, and almost 50% over the 'naive' implementation, by avoiding it:
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 reply to Re: About List::Util's pure Perl shuffle()
by BrowserUk
|
|