RE: [PHP] sessions - max number of variables before things get bad?

From: Date: Wed, 31 Jan 2001 17:16:26 +0000
Subject: RE: [PHP] sessions - max number of variables before things get bad?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37503@lists.php.net to get a copy of this message
The number of variables you are using probably won't make much of an impact on performance. You may want to test doing it both ways, you can use the gettimeofday function to do function profiling, it will return the time with microsecond accuracy. I'm guessing one call to the database at the start of script execution would be much faster assuming all the variables are in the same row. A lot of the time spent executing the query is spent on doing a disk seek, which will be greatly reduced if everything is placed in one call. Jon Snell -----Original Message----- From: Andrew Elliston [mailto:elists@elliston.net] Sent: Tuesday, January 30, 2001 1:12 PM To: php-general@lists.php.net Subject: [PHP] sessions - max number of variables before things get bad? I'm exploring sessions in PHP4 as I build a new site, and I have decided to rely on them more heavily than in the past. Basically, I'd like to set things up so that when someone logs into the site, all of their accounts variables are queried from a database and loaded into session variables (we're talking about 50 variables, most just 1-3 words). Does this sound reasonable for a relatively high traffic site? If I don't do this, then many of those variables will probably be queried from a database more than once during a visit, which seems unnecessary when I can use session variables. Are there any guidelines on the performance penalty for using large numbers of session variables? Or is the affect so minute that I really shouldn't worry about it? (especially compared to querying a database) Thanks, Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#37503) next »