Re: [PHP] could use some suggestions to speed this short piece of code up

2010-01-21 Thread Richard Quadling
2010/1/20 Rene Veerman : > this is at least 1000% faster > > the crux is that array()+=array() is way faster than any array_merge() > operations. > > global $hmGenKeys; > $hmGenKeys = 0; > function htmlMicroscope_generateRandomArray ($maxKeys, $maxDepth, > $maxDuration=-1) { >  global $hmGenKeys; >

Re: [PHP] could use some suggestions to speed this short piece of code up

2010-01-20 Thread Rene Veerman
this is at least 1000% faster the crux is that array()+=array() is way faster than any array_merge() operations. global $hmGenKeys; $hmGenKeys = 0; function htmlMicroscope_generateRandomArray ($maxKeys, $maxDepth, $maxDuration=-1) { global $hmGenKeys; if ($maxKeys!==null) { $hmGenKeys = $

Re: [PHP] could use some suggestions to speed this short piece of code up

2010-01-20 Thread tedd
At 12:42 PM +0100 1/20/10, Rene Veerman wrote: Hi, for http://mediabeez.ws/htmlMicroscope/ (lgpl) i need to make large & complex but _randomly filled_ test-arrays. Sometimes it's good to look at some of php's built in functions, like shuffle() and array_rand(). Cheers, tedd -- --- http

[PHP] could use some suggestions to speed this short piece of code up

2010-01-20 Thread Rene Veerman
Hi, for http://mediabeez.ws/htmlMicroscope/ (lgpl) i need to make large & complex but _randomly filled_ test-arrays. The code i wrote (hastily) for this is taking over 2 hours to generate 65k array values. I wonder if any of you see a way to improve it's speed. global $hmGenKeys; $hmGenKeys = 0;