Use the file size from FileValue instead of wastefully stat'ing the file again in order to get the file size in ParserInputSource#create (used multiple times for each BUILD file and Skylark .bzl file).
--
MOS_MIGRATED_REVID=102930870
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
index 12eea02..cf0bf4e 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
@@ -446,7 +446,7 @@
// Skylark dependencies.
reporter.handle(Event.progress("Loading package: " + packageName));
}
- inputSource = ParserInputSource.create(buildFilePath);
+ inputSource = ParserInputSource.create(buildFilePath, buildFileValue.getSize());
} catch (IOException e) {
env.getListener().handle(Event.error(Location.fromFile(buildFilePath), e.getMessage()));
// Note that we did this work, so we should conservatively report this error as transient.