)]}'
{
  "commit": "8707f1b5c5f6b66bbcb57b9873e9ee4157be80ab",
  "tree": "735c7e2ecc3e552d2bd2f1ec40c675f61039f681",
  "parents": [
    "127dd2a6d582528d6d61c4d838dc17385ef31abd"
  ],
  "author": {
    "name": "Nico Weber",
    "email": "thakis@chromium.org",
    "time": "Wed Sep 23 22:47:16 2026 -0700"
  },
  "committer": {
    "name": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Sep 23 23:15:21 2026 -0700"
  },
  "message": "Don\u0027t write order-only deps reachable through direct deps\n\nThe size of the generated ninja files is quadratic: NinjaCBinaryTargetWriter writes an order-only dep for every non-linkable\ndep of a target. `source_set(\"a\")` depending on `source_set(\"b\")`\ndepending on `source_set(\"c\")` produced:\n\nbuild phony/c.linkdeps: phony c.o\nbuild phony/b.linkdeps: phony b.o || phony/c.linkdeps\nbuild phony/a.linkdeps: phony a.o || phony/b.linkdeps phony/c.linkdeps\n\na.linkdeps listing c.linkdeps is not needed.\n\nInstead, only write order-only deps for:\n\n1. Direct deps (looking through groups, which have no build statement).\n2. Libraries inherited through direct deps whose build statement doesn\u0027t\n   list them (e.g. Rust libraries, or final targets that forward shared\n   libraries).\n3. Frameworks (create_bundle targets). ClassifyDependency() doesn\u0027t\n   treat them as non-linkable deps of non-final targets.\n\nhttps://issues.chromium.org/issues/40278737#comment7 compares ninja\nfiles before and after this patch and checks that they are equivalent.\n\nResults for a Chromium build (mac, arm64, is_debug\u003dfalse):\n\n                                      before         after\n  size of all loaded .ninja files     2634 MB        1009 MB\n    .linkdeps phony edges             1442 MB          15 MB\n    `||` on alink edges                181 MB           5 MB\n    `||` on link edges                  21 MB         0.3 MB\n  gn gen (hyperfine, 6 runs)          2.917s ± .047  2.160s ± .052\n    user / sys                        18.5s / 7.2s   12.3s / 4.7s\n\nChromium no-op builds of base_unittests (target already built, hyperfine,\nM-series Mac), for siso and various ninja versions:\n\n                                               before          after\n  siso v1.6.0 (autoninja), -offline            1.058s ± .031   735.5 ms ± 13.7\n    user / sys                                 7.0s / 2.0s     3.7s / 1.9s\n  depot_tools ninja (1.12.1)                   10.09s ± .10    4.37s ± .02\n  ninja v1.13.2                                6.388s ± .049   2.755s ± .009\n  ninja with some local changes to tweak perf  950.9 ms ± 5.1  535.8 ms ± 2.7\n\n(`siso -n` and `ninja -n` are within 2% of the no-op times.)\n\nNo intended behavior change.\n\nBug: chromium:40278737\nChange-Id: I517db1c641001e404d3e02ab0e653c1133076d7f\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/26740\nCommit-Queue: Nico Weber \u003cthakis@chromium.org\u003e\nReviewed-by: Takuto Ikuta \u003ctikuta@google.com\u003e\nReviewed-by: Nico Weber \u003cthakis@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8c8d2a093549c469d92add457a2443294e747259",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_binary_target_writer.cc",
      "new_id": "64611026b6ea61073b3f3b5f5b67649635285335",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_binary_target_writer.cc"
    },
    {
      "type": "modify",
      "old_id": "2f4977d53d62bd08a84373d25871099068c612c1",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_c_binary_target_writer_unittest.cc",
      "new_id": "746aa59df68e40308427413a93e21044e3077696",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_c_binary_target_writer_unittest.cc"
    }
  ]
}
