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;
>
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 = $
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
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;
4 matches
Mail list logo