discovery: cache the children mapping used during each discovery
During discovery, the `undecided` set keep shrinking. Therefore, the map
computed for an iteration N will be valid for iteration N+1. Instead of
computing the same data over and over we cache it the first time.
Our private pathological case speed up from about 7.5 seconds to about 6.3
seconds.
(starting from over 70s at the start of the full series)
from __future__ import absolute_import
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)