Been trying to find ways to improve perf for secondary indexes, this seemed like an obvious change given #5991 showed that the native Map/Set implementations are faster than our shims. Citation needed, but should be a perf boost.
Rebased on #5991 to avoid bitrotting myself.
BTW one major reason I'm doing this is that during my perf analyses I see lots of time spent in garbage collection, so I'm hunting down unnecessary allocations. This uniq() function was a major offender, but after this fix it barely registers.
(#6015) - separate funcs for map vs reduce
True failure; PhantomJS is not fond with how we're using Map and Set.
(#6015) - use Map and Set in mapreduce
Hm, I can repro the Phantom failure in Safari 5, but not in Safari 6. And I'm having a heck of a time running PhantomJS locally.
Awesome, this actually revealed a bug in our Map/Set implementation that wouldn't have been revealed otherwise. Also it turns out Safari 5 running on Windows 7 in VirtualBox is a good way to debug PhantomJS errors!
This should be green after the next run.