Significant performance improvements to ding for very large networks.

Change-Id: Ie7eefbfa3cb6bc8b46ad9b2de23ad743c43b351a