any perl performance experts awake?

James McDonald james at jamesmcdonald.id.au
Thu Apr 11 16:35:09 PDT 2013


Enjoyed this thread...

So passing $hash{key} is expensive because it does a copy of the hash but
passing $hash_ref->{key} stops the expensive copy operation.


On 12 April 2013 06:40, Andrew Gould <andrewlylegould at gmail.com> wrote:

> On Thu, Apr 11, 2013 at 3:37 PM, Lonni J Friedman <netllama at gmail.com>wrote:
>
>> I figured this out.  It was definitely the hash table lookups that
>> were the problem.  Or more accurately, the fact that I was passing the
>> entire hash table into the subroutine thousands of times, which meant
>> it was being copied thousands of times.  I switched to using a
>> hashref, and that cut the processing time from hours to a few minutes.
>>
>>
> Yeah!
>
> _______________________________________________
> Linux-users mailing list
> Linux-users at linux-sxs.org
> http://mailman.celestial.com/mailman/listinfo/linux-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/linux-users/attachments/20130412/a3ee8694/attachment.html 


More information about the Linux-users mailing list