From: Chad Perrin Date: 2008-10-30T11:22:55+09:00 Subject: array comparison --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I can easily write a program to compare the contents of arrays, of course. Ruby's great that way. In a matter of a minute or so, I could write a program that compares small numbers of items in a list with small numbers of items in another list and give me output that consists of things that appear in both, or those that don't appear in both, or those that appear in one and not the other. I find myself contemplating doing much the same thing, but with lists that contain millions of entries. I tend to guess that loading each list into an array and running a direct comparison of them: array_1 =3D [millions of things] array_2 =3D [millions of things] array_3 =3D array1 & array2 =2E . . would fill up RAM in a hurry and drag system performance on a typical desktop computer to a standstill. What sort of approach would the expert Ruby hackers suggest for achieving much the same ends without taking all week and risking a stack overflow? --=20 Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] Colin McFadyen: "Unix is not an 'a-ha' experience, it is more of a 'holy-shit' experience." --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkkJGKMACgkQ9mn/Pj01uKUc2gCfSSxguG6PDyymoWtFybAYT3xB 2lIAn0TCMkvkr1QbetCtTYXHxcADveTM =kXw5 -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--