Re: Sessions and threading

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

 



On Fri, 05 Nov 2004 00:26:24 +1100, Devraj Mukherjee
<lugs@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> The first part of the problem is that I need to be able to at all times
> maintain a readable set of objects in memory, I am planning to achieve
> that using session variables, but I hear that session variables can
> become very inefficient, how true is that?

If you store huge variable names then it will be slower than if you
store small ones.  Same with the session variable values.

PHP sessions variables are stored as a semi-colon delimited string of
text, with other appropriate seperation characters and descriptions of
the variables included.  I minimize my session variable names to a
single character and document them somewhere for future reference.  I
make sure and store minimum values for each variable, for example the
integer 1 instead of the string 'true' or 'yes', things like that add
up.  Sessions are as efficient as you make them.

Also, PHP doesn't have threads.  You can use some of the execution
functions to simulate them to some extent however: 
http://www.php.net/manual/en/ref.exec.php


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux