anchor.diff:          if (refSource == null) {
             throw new StateError('Unable to resolve $refUri in $librarySource');
           }
  -        _appendLibraryClosure(closure, refSource);
  +        // If we have already the closure for the 'refSource', use it.
  +        // Otherwise, continue computing recursively.
  +        // It's not the most efficient algorithm, but in practice we might
  +        // visit each library multiple times only for the first top-level
  +        // bundle requested in `getLibraryClosureBundles`.
  +        List<Source> refClosure = _libraryClosureMap[refSource];
  +        if (refClosure != null) {
  +          closure.addAll(refClosure);
  +        } else {
  +          _appendLibraryClosure(closure, refSource);
  +        }
         }
         contentSource.importedUris.forEach(appendLibrarySources);
         contentSource.exportedUris.forEach(appendLibrarySources);
  
positive.code:           List<int> sourceHash = _getSourceContentHash(source);
            byteSink.add(sourceHash);
          }
        });
      });
    }
  
negative.code:    */
    List<Source> _getLibraryClosure(Source librarySource) {
      return _libraryClosureMap.putIfAbsent(librarySource, () {
        Set<Source> closureSet = new Set<Source>();
        _appendLibraryClosure(closureSet, librarySource);
        List<Source> closureList = closureSet.toList();
        closureList.sort((a, b) => a.fullName.compareTo(b.fullName));
        return closureList;
      });
    }
  
  