Don't ask to ask, just ask | |
PerlMonks |
Re: (tye)Re: Can Schwartzian transform be modified to sort an arrayref uniquely?by khkramer (Scribe) |
on Jan 04, 2002 at 22:51 UTC ( [id://136341]=note: print w/replies, xml ) | Need Help?? |
Indeed. There are trade-offs everywhere: by default, I always write
so that the grep happens first. The speed is more important than the memory for almost everything I do. Here's a little bit of lies/damn-lies/statistics demonstrating the speed difference on an array in which most values appear twice.
And the output I get:
As a side note, I regard this kind of optimization as "habitual", rather than of the premature kind. <laugh>
In Section
Seekers of Perl Wisdom
|
|