On 15 Feb 2005 Richard Lynch wrote:

> Throw an ab (Apache Benchmark) test at it and find out.
> 
> Don't just guess or sit there wondering.
> 
> You could run test in about the time it took to compose this email --

Perhaps if you are already familiar with ab, which I'm not ... and if 
the server supports it, which it does not at this moment, development 
is on Windows, later testing and deployment on Linux.

> All the database code is already written for you on the PHP
> web-site, and it's about one 8.5x11 page of five (5) functions. 
> 
> Doesn't really sound like a complex test to me.

The data is an internal list of items on the form, all the form field 
specs, the data for the fields, default data for resetting the form, 
and a data structure for the forms class.  Most of these are in 
associative arrays, sometimes nested a couple of levels deep.  If I'm 
going to build a database structure that mirrors the array structure, 
and update it every time the array changes during development, that's 
hardly straightforward.  Without that, I'll have to serialize and 
unserialize the data -- and if I'm going to do that, I'd guess that I 
might as well use the session vars.  So maybe that answers the 
question, and the remainder (below) is theoretical.

> Sending the actual query and getting/storing the results will be
> chump-change compared to opening the db connection, almost for sure.

I do actually need a DB connection on every page anyway, so there's no 
benefit to avoiding one for this purpose.  But to me the likely 
consumer of cycles here with a database structure matching the data 
structure would be the conversion of MySQL data into an associative 
array, and I'd be comparing that to serializing and unserializing.  I 
don't think either is going to be trivial.

> These two will be neck-and-neck on performance, and will depend more
> on your hardware than on somebody else's experience with their
> hardware. 

Fair point.

> Particularly if you've got a 2-tier setup with database on one box
> and PHP on another, where your network hardware and cabling gets
> involved. 

Not in this case.

> If you have to choose between a meaningful variable name and
> performance considerations, buy more hardware! :-) 

Agreed!

Thanks,

--
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to