   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

    // return anything that uses that dependency.
    return invalidatedNodesFromIncrementalExternal ?? collectUntracedNodesUsing(fed)
  }
  
  private struct LazyModTimer {
    let externalDependency: ExternalDependency
    let info: IncrementalCompilationState.InitialStateComputer

    lazy var hasExternalFileChanged = (externalDependency.modTime(info.fileSystem) ?? .distantFuture)
      >= info.buildTime
  }

  /// Try to read and integrate an external dependency.

    /// 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) ||
      hasFileChanged(of: fed.externalDependency)

    guard callerWantsTheseChanges else {
      return DirectlyInvalidatedNodeSet()
