Use allInputs.size() as size hint for the ActionInputMap.

Without NestedSet-on-Skyframe, getInputDeps returned a map whose size was equal to the number of all inputs of that specific action.
With NestedSet-on-Skyframe, getInputDeps returned a singleton map which was growing over the course of action executions. The resulting size hint was growing with the number of actions being executed (or the total number of inputs), resulting in a ~30% GC tax for big builds.

After this CL, the size hint corresponds again to the expected size of the inputs, also for NestedSet-on-Skyframe.

RELNOTES: None
PiperOrigin-RevId: 291998196
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
index a936ee5..cf765ad 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
@@ -1174,14 +1174,16 @@
     // some deps are still missing.
     boolean populateInputData = !env.valuesMissing();
     NestedSetBuilder<Cause> rootCauses = NestedSetBuilder.stableOrder();
-    S inputArtifactData = actionInputMapSinkFactory.apply(populateInputData ? inputDeps.size() : 0);
+    ImmutableList<Artifact> allInputsList = allInputs.toList();
+    S inputArtifactData =
+        actionInputMapSinkFactory.apply(populateInputData ? allInputsList.size() : 0);
     Map<Artifact, Collection<Artifact>> expandedArtifacts =
         new HashMap<>(populateInputData ? 128 : 0);
     Map<Artifact, ImmutableList<FilesetOutputSymlink>> filesetsInsideRunfiles = new HashMap<>();
     Map<Artifact, ImmutableList<FilesetOutputSymlink>> topLevelFilesets = new HashMap<>();
 
     ActionExecutionException firstActionExecutionException = null;
-    for (Artifact input : allInputs.toList()) {
+    for (Artifact input : allInputsList) {
       ValueOrException2<IOException, ActionExecutionException> valueOrException =
           inputDeps.get(Artifact.key(input));
       if (valueOrException == null) {