Re: delete_global_variable & session_unset

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

 



Stanislav Malyshev wrote:
I recently noticed that session_unset in 5.2 (and probably in 6) uses
delete_global_variable which looks up global scope and then deletes
variable from it. Fine so far, but it does it in a loop - meaning it
looks for the global scope each time anew for each session variable! Also it seems to go through all CVs every time, which seems to be a waste of time too. Any reason not to do it this way:

1. Fetch the global scope
2. For each CV in the global scope, check if it should be deleted against session hash (since we have hashes it should be quick).

This way instead of stack depth*number of CVs*number of session vars we get only stack depth+number of CVs*hash lookup time. Which should be much better. So anybody sees any reason not to do it?

Best to ask the php-internals list - they write the C code that does all of this work ;)

--
Postgresql & php tutorials
http://www.designmagick.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