documentcloud/underscore — pull request #837 by charliesome (2012-10-23 10:21:23+00:00)
Title: Use a close-to-O(n) unique algorithm for arrays of strings.

For an array with a large number of strings (think a million or so), the current implementation of `_.uniq` takes an unreasonable amount of time to complete as it uses a quadratic algorithm.

I've implemented a second algorithm that should run at close to linear time for arrays of strings.

Unfortunately Map is not available on current JavaScript implementations, or we'd be able to use this faster algorithm on arrays of values of any type.