in reply to Re: Memory Use and/or efficiency passing scalars to subs
in thread Memory Use and/or efficiency passing scalars to subs
So, the scalars are not HUGE by todays standard. They are in the 40-64K size on average with some upto several hundred Kb. The problem is more about the fact that I am working through 100s to 1000s.
Anyhow, one process I ran took over 13 hours to complete, which is hard to live with. So, I am looking to speed things up.
One of the things I went looking for (among others) was to see if I was making unnecessary copies of data. Being new to perl I was not sure how arguments were passed to subroutines i.e. by value or by reference (aka ptrs).
I found a statement in a book on Perl that says "When you pass scalars to subroutines they are passed by reference,... which acts like the address of the scalar.". The books also says that arrays etc. are copied into @_.
Hummm, I thought, I need to look into what's going on here. Which is in part what prompted my questions. Thanks in advance for any insights.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Memory Use and/or efficiency passing scalars to subs
by tachyon (Chancellor) on Aug 31, 2003 at 07:08 UTC | |
by Anonymous Monk on Aug 31, 2003 at 15:04 UTC | |
by knexus (Hermit) on Aug 31, 2003 at 15:12 UTC | |
by tachyon (Chancellor) on Sep 01, 2003 at 00:42 UTC |