Speed up generation of dispatching tree