Re: [PHP] too slow to unset big array (after mem fragment)

2005-01-21 Thread Xuefer Tinys
On Fri, 21 Jan 2005 11:49:30 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> wrote: > > Perhaps you could store all data with an index of time rounded off to > minutes (hours, whatever). > > Example: > > //15 minutes -- Change larger/smaller for more/less frequent purges > $purge_time = 60 *

Re: [PHP] too slow to unset big array (after mem fragment)

2005-01-21 Thread Richard Lynch
Xuefer Tinys wrote: > if i have to unset portion of the $oldTracker. i have to scan? or any > other way? Perhaps you could store all data with an index of time rounded off to minutes (hours, whatever). Example: If you make the $purge_time *TOO* small, smaller than the frequency with which the

Re: [PHP] too slow to unset big array (after mem fragment)

2005-01-20 Thread Xuefer Tinys
On Wed, 19 Jan 2005 16:28:21 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > A question from another naive reader. > > Have you tried re-setting the array to an empty one, using array(), > instead of using unset()? indeed!, unset($arr); $arr = array(); or $arr = array(); directly it's sam

Re: [PHP] too slow to unset big array (after mem fragment)

2005-01-19 Thread kjohnson
> Xuefer Tinys wrote: > > i have a big array with 20k elements, i have no problem building it, > > because the elements is recv from socket, i can socket_select() on 1k > > clients, read from them. > > i plan to unset the whole array every 1hour > > this is a not big problem when for a few times, i

Re: [PHP] too slow to unset big array (after mem fragment)

2005-01-19 Thread Richard Lynch
Xuefer Tinys wrote: > i have a big array with 20k elements, i have no problem building it, > because the elements is recv from socket, i can socket_select() on 1k > clients, read from them. > i plan to unset the whole array every 1hour > this is a not big problem when for a few times, it takes me 0

[PHP] too slow to unset big array (after mem fragment)

2005-01-19 Thread Xuefer Tinys
i have a big array with 20k elements, i have no problem building it, because the elements is recv from socket, i can socket_select() on 1k clients, read from them. i plan to unset the whole array every 1hour this is a not big problem when for a few times, it takes me 0.02 seconds but after many hou