Re: problem with large arrays in php 4.3.2

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

 



Rodolfo Andrade wrote:
22k * 22 k =  484 millions...
that's really a lot of data and should take a lot of time and processing
power.

I don't think it's really a bug.

Yeah, I guess not. I guess ~500,000 records/sec isn't so terrible.
Is there a more efficient way to difference large sets of data?


Regards,
Rodolfo Andrade

----- Original Message ----- From: Jesse Guardiani
To: php-general@xxxxxxxxxxxxx
Sent: Tuesday, January 10, 2006 5:07 PM
Subject:  problem with large arrays in php 4.3.2


Hello,

I have an old version of php (4.3.2) that is acting rather strangely. I'm
searching two large arrays (approx 22,000 records in each) using
array_diff_key() from the PEAR PHP_Compat library:

        $result = $args[0];
        foreach ($args[0] as $key1 => $value1) {
            for ($i = 1; $i !== $array_count; $i++) {
                foreach ($args[$i] as $key2 => $value2) {
                    if ((string) $key1 === (string) $key2) {
                        unset($result[$key2]);
                        break 2;
                    }
                }
            }
        }

And I'm getting aweful performance. I know it's a ton of records (22,000 *
22,000), but it shouldn't take 16 minutes on a P4 Xeon 2.4ghz!

Has anyone seen this before? Is this a bug? Or are my math skills lacking
and
this is perfectly normal performance for the size of the data set?

Thanks!



--
Jesse Guardiani
Programmer/Sys Admin
jesse@xxxxxxxxxxx

--
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