[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Slow Script

On Wed, Feb 04, 2009 at 08:30:23PM -0600, Ron Johnson wrote:
> On 02/04/2009 08:04 PM, Alex Samad wrote:
> >well he is only comparing int by the looks of (we are just guessing
> >until we get more info) so 4 long int records ...
> Record overhead?  (Python has it.  Don't know about Perl.)

Oh, yes...  Perl most certainly does.

It was fully explained in a recent discussion on perlmonks.org if you
want to try to find all the gory details, but, IIRC, it's something like
the Perl array physically being a map of possibly non-contiguous memory
blocks each of which holds a list of pointers to data structures which
contain the actual data along with (in C terms) type definitions (e.g.,
whether it's stored as a string, an int, a float, etc.).  That's the
cost you pay for the convenience of having a single generic "scalar"
data type and arrays that manage their own memory usage.

Dave Sherohman
NomadNet, Inc.

Reply to: