)]}'
{
  "commit": "47b40ef49e678319c0dac767a95a363cc3f1f6cb",
  "tree": "cf1c295a938c6d15e927a0843bf4e885bc6a1c00",
  "parents": [
    "bfffe163a23e55b944a3b4d5b9ce0ded126f414a"
  ],
  "author": {
    "name": "Takuto Ikuta",
    "email": "tikuta@google.com",
    "time": "Tue Feb 24 22:45:42 2026 +0900"
  },
  "committer": {
    "name": "GN LUCI",
    "email": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Feb 24 05:56:00 2026 -0800"
  },
  "message": "Optimize HeaderChecker file I/O by parsing files only once\n\nInstead of scheduling a separate task for each Target that includes a\ngiven file, this change groups targets by the file they need to check.\nWe then pass the list of targets to `CheckFile`, which opens the file,\nreads its contents, and parses the `#include` directives exactly once.\n\nThis significantly reduces:\n- File I/O (open/read/close operations are reduced to 1 per file)\n- CIncludeIterator allocations and parsing overhead\n- Number of tasks scheduled in WorkerPool, reducing condition variable waits\n  and thread synchronization overhead.\n\nBased on local sample profiling with `gn gen --check` on no clang\nmodules build, total self-time spent in system locks (WorkerPool waits)\nand I/O decreased substantially.\n\n`hyperfine` benchmarking shows ~1.23x speedup and a ~43% reduction in\n`System` execution time (kernel mode threads / locks / IO overhead) on\nmacOS:\n\nBenchmark 1: out/gn_main gen ...\n  Time (mean ± σ):      7.689 s ±  0.049 s    [User: 27.350 s, System: 38.073 s]\n  Range (min … max):    7.581 s …  7.749 s    10 runs\n\nBenchmark 2: out/gn_fast gen ...\n  Time (mean ± σ):      6.265 s ±  0.047 s    [User: 27.103 s, System: 21.643 s]\n  Range (min … max):    6.149 s …  6.312 s    10 runs\n\nSummary\n  out/gn_fast ... ran\n    1.23 ± 0.01 times faster than out/gn_main ...\n\nBug: 484862257\nChange-Id: If5cb8b04674fce929d972e4759021578e79e87ed\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/21220\nReviewed-by: David Turner \u003cdigit@google.com\u003e\nCommit-Queue: Takuto Ikuta \u003ctikuta@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c5c2bfe45210790bdc0d9d877909e040c02e7054",
      "old_mode": 33188,
      "old_path": "src/gn/header_checker.cc",
      "new_id": "aba451bf9e1f62f0ec32d616c4326835f9e36a86",
      "new_mode": 33188,
      "new_path": "src/gn/header_checker.cc"
    },
    {
      "type": "modify",
      "old_id": "f0e0408d41366b25429dfccfe9e8f901b44da43c",
      "old_mode": 33188,
      "old_path": "src/gn/header_checker.h",
      "new_id": "083272fd86b99cccdff444850cc10551f9183b17",
      "new_mode": 33188,
      "new_path": "src/gn/header_checker.h"
    }
  ]
}
