From 5c601f82242c58ad04b9db7839b9f736ff6d7044 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 17 Sep 2026 12:41:59 +0000 Subject: [PATCH] Make the filesystem benchmark test less expensive (#7794) While some of the slowness here is unrelated, there isn't really any reason to test even as much of the benchmark as it is. --- common/BUILD | 4 ++-- common/filesystem_benchmark.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/BUILD b/common/BUILD index 41c292327e5d..c7ac6c962a90 100644 --- a/common/BUILD +++ b/common/BUILD @@ -287,9 +287,9 @@ sh_test( srcs = [":filesystem_benchmark"], args = [ "--benchmark_dry_run", - # Restrict the sizes to 4-digit ones or smaller to keep test times low. + # Restrict the sizes to 2-digit ones or smaller to keep test times low. # The `$$` is repeated for Bazel escaping of `$`. - "--benchmark_filter=^[^/]+(/[0-9]{1,4}(/[0-9]+)?)?/real_time$$", + "--benchmark_filter=^[^/]+(/[0-9]{1,2}(/[0-9]+)?)?/real_time$$", ], ) diff --git a/common/filesystem_benchmark.cpp b/common/filesystem_benchmark.cpp index 185448c419a8..2db8f7f589b5 100644 --- a/common/filesystem_benchmark.cpp +++ b/common/filesystem_benchmark.cpp @@ -444,9 +444,9 @@ auto BM_CreateDirectories(benchmark::State& state) -> void { CARBON_CHECK(existing_depth <= depth); CARBON_CHECK(depth > 0); - // Use a batch size of 10 to get avoid completely swamping the measurements + // Use a batch size of 5 to get avoid completely swamping the measurements // with overhead from creating existing directories and cleaning up. - constexpr int BatchSize = 10; + constexpr int BatchSize = 5; // Pre-build both the paths and the existing paths. Note that we use // relatively short paths here, which if anything makes the benefits of the