Add the option --experimental_max_directories_to_eagerly_visit_in_globbing. The first legacy glob that a package requires will, if this option is enabled, cause up to that many directories to be eagerly visited by a glob(['**']). The results are thrown away for memory reasons.
--
MOS_MIGRATED_REVID=135148361
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/PackageCacheOptions.java b/src/main/java/com/google/devtools/build/lib/pkgcache/PackageCacheOptions.java
index 0664229..f22fceb 100644
--- a/src/main/java/com/google/devtools/build/lib/pkgcache/PackageCacheOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/pkgcache/PackageCacheOptions.java
@@ -110,6 +110,17 @@
help = "Number of threads to use for glob evaluation.")
public int globbingThreads;
+ @Option(
+ name = "experimental_max_directories_to_eagerly_visit_in_globbing",
+ defaultValue = "-1",
+ category = "undocumented",
+ help =
+ "If non-negative, the first time a glob is evaluated in a package, the subdirectories of "
+ + "the package will be traversed in order to warm filesystem caches and compensate for "
+ + "lack of parallelism in globbing. At most this many directories will be visited."
+ )
+ public int maxDirectoriesToEagerlyVisitInGlobbing;
+
@Option(name = "fetch",
defaultValue = "true",
category = "undocumented",