Optimize GC usage of iterating over all elements of GroupedLists when we don't care about the group structure, and simplify the logic for prefetching old deps.

PiperOrigin-RevId: 187681887
diff --git a/src/main/java/com/google/devtools/build/skyframe/QueryableGraph.java b/src/main/java/com/google/devtools/build/skyframe/QueryableGraph.java
index 26422dd..8c5af09 100644
--- a/src/main/java/com/google/devtools/build/skyframe/QueryableGraph.java
+++ b/src/main/java/com/google/devtools/build/skyframe/QueryableGraph.java
@@ -50,6 +50,15 @@
           throws InterruptedException;
 
   /**
+   * A prefetch call may be used to hint to the graph that we may call {@link #getBatch} on the
+   * specified keys later.
+   */
+  default void prefetchBatch(
+      @Nullable SkyKey requestor, Reason reason, Iterable<? extends SkyKey> keys) {
+    // Do nothing.
+  }
+
+  /**
    * Examines all the given keys. Returns an iterable of keys whose corresponding nodes are
    * currently available to be fetched.
    *