> -----Original Message-----
> From: Darren Duncan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 03, 2005 6:28 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Request for comment: Proposed SQLite API changes
> 
> At 4:22 PM -0700 11/3/05, Robert Simpson wrote:
> >It's 100,000 more memory allocations and about 4.6mb of string 
> >copies SQLite is doing behind the scenes.  Every time SQLite 
> >prepares a statement it allocates and copies the string.  If you're 
> >inserting a million rows into a database using the above "cheese" 
> >method (which I hate but a lot of folks do anyway) then that's a 
> >pretty serious performance hit IMO.
> 
> This only happens if you are not reusing prepared statements for each 
> row going into the same table.

I know, that's just what I said.  I also said I don't do this, but many
people do.

> And if you're not reusing prepared statements, you're already doing
> 100,000 memory allocations that you shouldn't be doing,

Not necessarily.  One could have a static fixed-size buffer that is
constantly changing and re-preparing -- but that's not the point.

> for the statement handle itself, and have already 
> hit yourself.

So since they've already hit themselves once, why not hit them again?

> Use prepared statements and both hits are brought down 
> to something negligible.

And just like telling people smoking is bad for them, they will continue to
do it.  Anyway, the point is moot since DRH said the authentication callback
problem would be a showstopper.

Robert



Reply via email to