I just upgraded from XCode 7.2 to XCode 7.3. I have a moderately large C++ project that used to take a few seconds to link. With the new linker, the same project now takes multiple minutes to link.
This only happens with our debug builds. If I switch the compile flags from "-O0" to "-O2" (no other changes to any command-line arguments), linking goes back to its usual speed. ("-O1" is just as slow as "-O0".)
I ran the "Instruments" Time Profiler against "ld"; it's spending virtually all of its time in stack frames that start like this:
ld (4948)
Main Thread 0x3cd90
start
main
ld::passes::dedup::doPass(Options const&, ld::Internal&)
std::__1::unordered_map<ld::Atom const*, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> >, ld::passes::dedup::atom_hashing, ld::passes::dedup::atom_equal, std::__1::allocator<std::__1::pair<ld::Atom const* const, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> > > > >::operator[](ld::Atom const* const&)
Does this look familiar to anyone? Any suggestions?