)]}'
{
  "commit": "2ab81981a83bb790d40305773284476e8d7bef4c",
  "tree": "1d8027fa8cd980e9a6fa179ac811d9042537ad99",
  "parents": [
    "4c122caddf1bdb454a2e2c06d850ba58fd508b90"
  ],
  "author": {
    "name": "Takuto Ikuta",
    "email": "tikuta@google.com",
    "time": "Tue Sep 15 16:12:48 2026 +0900"
  },
  "committer": {
    "name": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Sep 15 16:55:16 2026 -0700"
  },
  "message": "[gn] Shard StringAtomSet to avoid lock contention\n\nPreviously, StringAtomSet used a single global std::mutex to protect the\nglobal KeySet and Slab storage. On high-core-count machines, worker\nthreads frequently miss their thread-local cache for new strings across\nthousands of files, causing intense lock contention on this single\nmutex.\n\nProfiling Chromium\u0027s //out/Default build generation with official GN\nrelease build settings (Fuchsia Clang + libc++ + static libjemalloc.a +\nLTO) showed that kernel futex waits on StringAtomSet::find() accounted\nfor over 70% of the total System CPU time.\n\nThis change shards StringAtomSet into 256 independent, cache-aligned\n(alignas(64)) partitions indexed by the string hash\u0027s upper bits. In\naddition, both StringAtomSet and ThreadLocalCache pre-insert\nkEmptyString in their constructors so that empty strings hit directly\nwithout slab allocation or extra branches in the lookup hot path.\n\nBenchmark results (`gn gen out/Default` on Chromium, 5 runs with\nhyperfine, official release build configuration):\n- Wall-clock time: 2.755s ± 0.029s -\u003e 2.262s ± 0.038s (-493ms / 1.22x faster)\n- System CPU time: 14.079s -\u003e 4.030s (-10.05s / -71.4% reduction!)\n- User CPU time:   23.740s -\u003e 22.889s (-0.85s)\n\nOutput ninja files remain bit-for-bit identical across all 14,639 files.\n\nTAG\u003dagy\nCONV\u003d4cb5d931-60a8-4f44-8632-3e8d9fb10a8d\nChange-Id: I2d09d9f25c6c86482ef420282a41606308b8d8d4\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/26540\nCommit-Queue: Takuto Ikuta \u003ctikuta@google.com\u003e\nReviewed-by: Matt Stark \u003cmsta@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "71f9b875e2e42310ae2cef9d75591b8d13032046",
      "old_mode": 33188,
      "old_path": "src/gn/string_atom.cc",
      "new_id": "f9b3be78542f2fdc4e9a9c547b8db927be504cb6",
      "new_mode": 33188,
      "new_path": "src/gn/string_atom.cc"
    }
  ]
}
