Speed up find-unused-diagnostics. Now runs in less than a second instead of more than a minute.