RE: [PHP] Size of Arrays

2004-01-30 Thread Chris W. Parker
Galen on Friday, January 30, 2004 12:35 PM said: > On huge arrays (hundreds of thousands of elements, three dimensions, > several megabytes) the performance impact is huge! The downside is > you'll probably have to use numeric keys instead of associative, but > for b

Re: [PHP] Size of Arrays

2004-01-30 Thread Galen
Should anyone be planning experiments or projects with large arrays, use a for() loop instead of a foreach() loop when working with your array. And be sure to count the array, stick that result into a variable, then compare against the variable instead of running the count() again. On huge arr

Re: [PHP] Size of Arrays

2004-01-30 Thread Stuart
Gandolf wrote: To the OP, why do you need to store all the items in memory at the same time? Can't you read some, process them then read the next lot, process them, read the next lot etc? No I couldn't because we have to use 1,6 Mio values direktly. If we read them each for each it will take a

Re: [PHP] Size of Arrays

2004-01-30 Thread Gandolf
Hi at all, > Indeed. The following script had my machine happily swapping like crazy > at 320,000 array items (each being 1k, task manager showed 640meg total > memory in use on this development machine with 512meg RAM running WinXP). > > while (@ob_end_flush()); > $data = Array(); >

Re: [PHP] Size of Arrays

2004-01-29 Thread David T-G
Stuart, et al -- ...and then Stuart said... % % David T-G wrote: % >2) Five minutes with a test script would tell you, and I bet google could ... % >all) it breaks. My bet is that you'l exhaust RAM and swap before you % >break php, especially if you actually store something -- like, say, 32 % >b

Re: [PHP] Size of Arrays

2004-01-29 Thread Stuart
David T-G wrote: 2) Five minutes with a test script would tell you, and I bet google could tell you, so why bother the list with a question you could so easily answer for yourself? Go and try it and then report back where (if at all) it breaks. My bet is that you'l exhaust RAM and swap before you

Re: [PHP] Size of Arrays

2004-01-29 Thread David T-G
Sandro -- ...and then Gandolf said... % % Hello NG, Hello from the mailing list :-) % could anyone tell me how much is be the biggest size of an array - how many % values could an array have?! % I have to import 100.000 to 10.000.000 values an I have to know where the % limit is. 1) I know of

[PHP] Size of Arrays

2004-01-29 Thread Gandolf
Hello NG, could anyone tell me how much is be the biggest size of an array - how many values could an array have?! I have to import 100.000 to 10.000.000 values an I have to know where the limit is. Thanks a lot, Sandro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht