juliangruber / intersect

Find the intersection of two arrays
MIT License
32 stars 8 forks source link

Change to using object lookups rather than array lookups #1

Closed minuteman3 closed 11 years ago

minuteman3 commented 11 years ago

This change makes the intersection O(n+m) rather than O(n*m), resulting in incredibly significant speed ups for large arrays.

minuteman3 commented 11 years ago

Ugh, don't pull this, apparently it breaks performance on small sets. I'll try and fix that and then submit again later.