)]}'
{
  "commit": "bfffe163a23e55b944a3b4d5b9ce0ded126f414a",
  "tree": "c45e8e78114ba6cacc996d60f0b0232948a02cae",
  "parents": [
    "2c775ed71ed9c7ceb11823ced47a1a2640883403"
  ],
  "author": {
    "name": "Takuto Ikuta",
    "email": "tikuta@google.com",
    "time": "Tue Feb 24 16:11:40 2026 +0900"
  },
  "committer": {
    "name": "GN LUCI",
    "email": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Feb 24 00:18:52 2026 -0800"
  },
  "message": "Optimize reachability cache to drastically reduce BFS executions\n\nThe most significant part of this optimization is caching the\nreachability search results starting from a \u0027from_target\u0027. By sharing\nthis cache across all files and includes within the same target, we\navoid redundant, expensive BFS traverses, which was the primary\nbottleneck.\n\nBenchmark results on macOS (hyperfine):\n\nBenchmark 1: gn_main gen out/no_clang_modules/ --check\n  Time (mean ± σ):     15.978 s ±  0.107 s    [User: 139.317 s, System: 20.336 s]\n  Range (min … max):   15.845 s … 16.141 s    10 runs\n\n\nBenchmark 2: gn_bfs_cache gen out/no_clang_modules/ --check\n  Time (mean ± σ):      7.578 s ±  0.048 s    [User: 23.380 s, System: 38.648 s]\n  Range (min … max):    7.481 s …  7.656 s    10 runs\n\nSummary\n  gn_bfs_cache ran 2.11 ± 0.02 times faster than gn_main\n\nAdditionally, this change:\n- Shards the cache into 64 shards using std::unordered_map and fine-grained\n  locking (std::shared_mutex) to reduce lock contention during concurrent\n  checks.\n- Uses std::unique_ptr for ReachabilityCache to safely manage non-copyable\n  objects (due to the included mutex).\n\nBug: 484862257\nChange-Id: I9a85e813ba942384eb1237fa965e447b1224659d\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/21160\nReviewed-by: David Turner \u003cdigit@google.com\u003e\nCommit-Queue: Takuto Ikuta \u003ctikuta@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "562644d24857619f852aec07f0d32056f606b2a9",
      "old_mode": 33188,
      "old_path": "src/gn/header_checker.cc",
      "new_id": "c5c2bfe45210790bdc0d9d877909e040c02e7054",
      "new_mode": 33188,
      "new_path": "src/gn/header_checker.cc"
    },
    {
      "type": "modify",
      "old_id": "8f364456a5698409e0bbeba28399c396181d1b40",
      "old_mode": 33188,
      "old_path": "src/gn/header_checker.h",
      "new_id": "f0e0408d41366b25429dfccfe9e8f901b44da43c",
      "new_mode": 33188,
      "new_path": "src/gn/header_checker.h"
    },
    {
      "type": "modify",
      "old_id": "00a82d34ce659c2139907b71957dcd012900adbd",
      "old_mode": 33188,
      "old_path": "src/gn/header_checker_unittest.cc",
      "new_id": "ec5a397c37565185f5470cd643f8586601794bdf",
      "new_mode": 33188,
      "new_path": "src/gn/header_checker_unittest.cc"
    }
  ]
}
