)]}'
{
  "commit": "69b9867bfb80ae8dcb5f1d958d787158de1397ff",
  "tree": "6f464a46b5d9a0bf2c890107b1a4453a6473496f",
  "parents": [
    "1e3b4f740717a9d6f0de39de90cedc6deb4e7255"
  ],
  "author": {
    "name": "David \u0027Digit\u0027 Turner",
    "email": "digit@google.com",
    "time": "Tue Mar 23 11:59:06 2021 +0100"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Mon Nov 22 19:34:43 2021 +0000"
  },
  "message": "[target] Turn many Target::foo_ fields into std::unique_ptr\u003cFoo\u003e ones.\n\nThere is only one Target class in GN that has accreted over time\nmany fields that are only used in a small number of cases. However,\nmany of them are quite large and complex.\n\nDue to this, the Target::~Target() destructor appears high in profiling\ntraces, and heap usage is dominated by Target allocation. This CL tries\nto reduce the problem by making most of these target-type specific\nfields into std::unique_ptr\u003cFoo\u003e members instead.\n\nThe actual values are created on demand, with static constant globals\nused for defaults for targets that don\u0027t need them.\n\nMeasurements with an optimized GN build and the Fuchsia source tree\nshow a reduction of about 200 MiB (5% of 3.8 GiB) in peak RAM usage,\nand a reduction of about half a second in \"gn gen\" time.\n\nFor the Chromium build, there is no noticeable difference on either\nmetrics.\n\n+ Refactor SwiftValues::OnTargetResolved() slightly to avoid\n  creating un-needed SwiftValues instances when not needed\n  (i.e. for most targets).\n\n+ Create Target::GeneratedFile structure type to hold all\n  fields related to generated_file() targets as well.\n\nMeasurements:\n\n        FUCHSIA BEFORE\n\n        Done. Made 173241 targets from 5370 files in 17633ms\n        Done. Made 173241 targets from 5370 files in 17687ms\n        Done. Made 173241 targets from 5370 files in 17691ms\n        Done. Made 173241 targets from 5370 files in 17730ms\n        Done. Made 173241 targets from 5370 files in 17761ms *\n        Done. Made 173241 targets from 5370 files in 18130ms\n        Done. Made 173241 targets from 5370 files in 18306ms\n        Done. Made 173241 targets from 5370 files in 19193ms\n        Done. Made 173241 targets from 5370 files in 19232ms\n\n        3787204\n        3799056 *\n        3803784\n\n        FUCHSIA AFTER\n\n        Done. Made 173241 targets from 5370 files in 16473ms\n        Done. Made 173241 targets from 5370 files in 16529ms\n        Done. Made 173241 targets from 5370 files in 16717ms\n        Done. Made 173241 targets from 5370 files in 16859ms\n        Done. Made 173241 targets from 5370 files in 17014ms *\n        Done. Made 173241 targets from 5370 files in 17192ms\n        Done. Made 173241 targets from 5370 files in 17543ms\n        Done. Made 173241 targets from 5370 files in 17538ms\n        Done. Made 173241 targets from 5370 files in 17946ms\n\n        3600740\n        3609616 *\n        3616088\n\nChange-Id: Iedc65a3250cf73b82ae0b5d1480c32db9fd507bb\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/12401\nReviewed-by: Brett Wilson \u003cbrettw@chromium.org\u003e\nCommit-Queue: David Turner \u003cdigit@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6479f2107cde284d33b4d893972fcb195f3656fd",
      "old_mode": 33188,
      "old_path": "src/gn/config_values_extractors.h",
      "new_id": "45b1f2577f9f28be06a3a717ab95fb4df5930694",
      "new_mode": 33188,
      "new_path": "src/gn/config_values_extractors.h"
    },
    {
      "type": "modify",
      "old_id": "6531291766781563ff10b6fb55b30c675bcc1336",
      "old_mode": 33188,
      "old_path": "src/gn/rust_values.cc",
      "new_id": "3043458e3016b1fff230b7c20e43afe01fd1aad1",
      "new_mode": 33188,
      "new_path": "src/gn/rust_values.cc"
    },
    {
      "type": "modify",
      "old_id": "a9677a622af97969d8b977a051ff75f5023b5703",
      "old_mode": 33188,
      "old_path": "src/gn/swift_values.cc",
      "new_id": "a70c72f096de9268fa3c6e950a954ac7b3da90ac",
      "new_mode": 33188,
      "new_path": "src/gn/swift_values.cc"
    },
    {
      "type": "modify",
      "old_id": "c52973843a974f11ccc02a7223cbe521d74db484",
      "old_mode": 33188,
      "old_path": "src/gn/swift_values.h",
      "new_id": "3852366637a3566d2dcaf7889dc7ce4710e9d162",
      "new_mode": 33188,
      "new_path": "src/gn/swift_values.h"
    },
    {
      "type": "modify",
      "old_id": "d9c02d3be46f6077cb3cf884b2d4294fbdd9694b",
      "old_mode": 33188,
      "old_path": "src/gn/target.cc",
      "new_id": "62f17cd5822c60d7c3b04d7ad3b4feabb223e6af",
      "new_mode": 33188,
      "new_path": "src/gn/target.cc"
    },
    {
      "type": "modify",
      "old_id": "fec9731140ff836dc794728040ce8775951055ba",
      "old_mode": 33188,
      "old_path": "src/gn/target.h",
      "new_id": "ee5061b1c381ff3d8c6e102f7d7ff7be12db9248",
      "new_mode": 33188,
      "new_path": "src/gn/target.h"
    }
  ]
}
