   let dotFileWriter: DependencyGraphDotFileWriter?
 
   @_spi(Testing) public var phase: Phase
+
+  /// Minimize the number of file system modification-time queries.
+  private var externalDependencyModTimeCache = [ExternalDependency: Bool]()
 
   public init(_ info: IncrementalCompilationState.InitialStateComputer,
               _ phase: Phase

    /// When building a graph from scratch, an unchanged but new-to-the-graph external dependendcy should be ignored.
    /// Otherwise, it represents an added Import
    let callerWantsTheseChanges = (phase.isUpdating && isNewToTheGraph) ||
      lazyModTimer.hasExternalFileChanged

    guard callerWantsTheseChanges else {
      return DirectlyInvalidatedNodeSet()


    let isNewToTheGraph = fingerprintedExternalDependencies.insert(fed).inserted

    // If the graph already includes prior externals, then any new externals are changes
    // Short-circuit conjunction may avoid the modTime query
    let shouldTryToProcess = info.isCrossModuleIncrementalBuildEnabled &&
      (isNewToTheGraph || hasFileChanged(of: fed.externalDependency))

    // Do this no matter what in order to integrate any incremental external dependencies.
    let invalidatedNodesFromIncrementalExternal = shouldTryToProcess
