Comparing large arrays

Comparing large arrays

am 22.02.2010 13:33:18 von MSummers

------=_NextPart_000_0001_215AEAFE.10A58F35
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

I have two arrays, generated from even larger text source files (one is
~50K elements and the other is about 90K elements). I need to compare the
two, and produce a result array that contains only the elements of array 1
that are not also in array 2. It seems like array_diff() is exactly the
tool needed, but it times out. So my questions are -

1. Should I be getting a time out with this size job (I don't have a good
feel for this - although 5x10^9 comparisons certainly sounds like lots!)?
2. Is there a better way to do this?

Thanks,

--

Murray

------=_NextPart_000_0001_215AEAFE.10A58F35--

Re: Comparing large arrays

am 22.02.2010 13:37:38 von Pierre Joye

hi,

You can disable the time limit, or use a database, which may be a much
better tool for that.

Cheers,

On Mon, Feb 22, 2010 at 1:33 PM, Murray R. Summers
wrote:
> I have two arrays, generated from even larger text source files (one is
> ~50K elements and the other is about 90K elements). =A0I need to compare =
the
> two, and produce a result array that contains only the elements of array =
1
> that are not also in array 2. =A0It seems like array_diff() is exactly th=
e
> tool needed, but it times out. =A0So my questions are -
>
> 1. =A0Should I be getting a time out with this size job (I don't have a g=
ood
> feel for this - although 5x10^9 comparisons certainly sounds like lots!)?
> 2. =A0Is there a better way to do this?
>
> Thanks,
>
> --
>
> Murray
>



--=20
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php