Not the case in this question. What is being returned is the reference -
values other than a single reference are not being copied. This is how
fetchrow_arrayref works as well - only a reference to the array is returned,
but when columns are bound, the reference must be dereferenced somehow so
that I get to the values of the columns as I bound them. I expected there to
be noticeable overhead there, and was thinking by not binding columns, and
dereferencing the returned reference directly I should be able to avoid that
small overhead. My question is aksed because there is NO difference - not
that the direct dereference is slower.
Try what I wrote. You'll get an array reference as the value of $row - not
an array. so
$row = $selecth->fetch; #returns a reference - not an array
is not the same as:
@row = $selecth->fetchrow; #copies into an array.
So what I don't understand is what how bind_columns is dereferencing this in
such a manner as to allow me to refer to the columns as scalars WITHOUT
showing seeming to show any overhead.
Steve H.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 26, 2001 10:35 AM
To: Steve Howard; [EMAIL PROTECTED]
Subject: Re: another performance question.
-- Steve Howard <[EMAIL PROTECTED]> on 08/26/01 10:08:23 -0500
> dereferencing in the code (is there no overhead to the binding of
> columns?).
Binding uses pre-allocated space to return the result and is
usually faster. fetch_blah calls have to allocate space for
the result, which is what slows them down.
sl