Performance increase by caching parts of the computations for xrefs()
and dominates()