On Sunday, May 19, 2002, at 02:38 , Tagore Smith wrote:
> drieux wrote:
[..]
>> http://www.wetware.com/drieux/pbl/BenchMarks/uniqCounts.txt
>>
>> ok, so my OCD is benchmarking -
Tagore - thanks for the review - and I fear we agree,
although I feel I owe you some clarifications;
[..]
> and making thorough
> benchmarks is a black art that I am not a master of.
arcane, esoteric, convoluted... but not really a black art.
{ or I don't think we have sacrificed any human's lately...
there was some confusion early on.... 8-) }
> I could be wrong about
> this, but I thought that there were some performance issues with using map
> for side effects on large arrays in current perl implementations.
I have been playing around with varying the sizes of the arrays,
and the complexities of the patterns - as you will note from the
URL and I'm within a Gnats YakFest of just working up a random
string generator and size muncher that will call the time thingie
with variations on the size of the arrays and the like just to
make sure that I get a better distribution...
> Something
> along the lines of map using the stack to store the returned list. At any
> rate it seems like at the very least the map uses extra space.
that is the other side of the problem that I am trying to also work
out if anyone has a clean vector on how better to do the size
validation portion of this....
> If you're really compulsive about benchmarking these things you might try
> this with a really large array.
I've been using on the order of 5,000 element arrays....
{ what I would expect to be a reasonable size value. There
are other benchmarks up there that cover the fact that there
are portions of perl tricker that are clearly size dependent... }
> Stylistically, I prefer not to use map for side effects, but I'm aware
> that
> this is a contentious issue, and I'm not religious about it :). It's good
> to
> be aware that it's an option- thanks for the link.
to be patently honest - I merely proposed it because, well,
I bench marked it - and I still feel twitchy about map in
general since I am not as 'sold' on it as a 'feature'. There
are times when it is cool... but.... I'm not too sure I want
to rip open the code to look inside too deeply - yet.
I also opted to do the forward and backward forloops
foreach (@list) {....}
over and against the
$seen{$_}++ foreach @list;
to show that they do not change anything I could track...
And to be honest, I wanted to illicit the references to any
known issues one way or the other....
I am Religious - and a Holy Defender of the One True Orthodox Perl Way.
{ it's just not always as easy as it looks.... }
I'm still trying to get a reset of @_ due to a signal trap...
and have not yet found a way to fault it the way I would prefer...
If anyone happens to have any gooder ways in the back of their head...
ciao
drieux
---
for the over the edge side of it with when is it
simpler v. faster - to consume an array for uniqness:
http://www.wetware.com/drieux/pbl/BenchMarks/randTest.txt
includes the fisher_yates_shuffle in the mix.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]