)]}'
{
  "commit": "c1903db4dbfe5ab8e2ec704e203535dae53c2adc",
  "tree": "c14a32f8294f2396cb37e5947287e93c31e74040",
  "parents": [
    "74a6bbb3463be9c30a133a80d4e5bbdbd0b6ee2c"
  ],
  "author": {
    "name": "Heschi Kreinick",
    "email": "heschi@google.com",
    "time": "Fri Jul 24 17:17:13 2020 -0400"
  },
  "committer": {
    "name": "Heschi Kreinick",
    "email": "heschi@google.com",
    "time": "Mon Aug 10 19:02:17 2020 +0000"
  },
  "message": "internal/memoize: switch from GC-driven to explicit deletion\n\nThe GC-based cache has given us a number of problems. First, memory\nleaks driven by reference cycles: the Go runtime cannot collect cycles\ninvolving finalizers, which prevents us from writing natural code in\nBind callbacks. If we screw it up, we get a mysterious leak that takes a\nlong time to track down. Second, the behavior is generally mysterious;\nit\u0027s hard to predict how long a value lasts, and harder to tell if a\nvalue being live is a bug. Third, we think that it may be interacting\npoorly with the GC, resulting in unnecessary memory usage.\n\nThe structure of the values we put in the cache is not actually that\ncomplicated -- there are only 5 significant types: parse, typecheck,\nanalyze, parse mod, and analyze mod. Managing them manually should not\nbe conceptually difficult, and in fact we already do most of the work\nin (*snapshot).clone.\n\nIn this CL the cache adds the concept of \"generations\", which function\nas reference counts on cache entries. Entries are still global and\nshared across generations, but will be explicitly deleted once no\ngenerations refer to them. The idea is that each snapshot is a new\ngeneration, and can inherit entries from the previous snapshot or leave\nthem behind to be deleted.\n\nOne obvious risk of this scheme is that we\u0027ll leave dangling references\nto values without actually inheriting them across generations. To\nprevent that, getting a value requires passing in the generation at\nwhich it\u0027s being read, and an error will be returned if that generation\nis dead.\n\nChange-Id: I4b30891efd7be4e10f2b84f4c067b0dee43dcf9c\nReviewed-on: https://go-review.googlesource.com/c/tools/+/242838\nRun-TryBot: Heschi Kreinick \u003cheschi@google.com\u003e\nTryBot-Result: Gobot Gobot \u003cgobot@golang.org\u003e\nReviewed-by: Rebecca Stambler \u003crstambler@golang.org\u003e\nReviewed-by: Robert Findley \u003crfindley@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ed74ee11fba7aab6a3d225cc204fb92987dd7e14",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/analysis.go",
      "new_id": "3257324cf55c8f29976b08f9dd1569092d70c041",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/analysis.go"
    },
    {
      "type": "modify",
      "old_id": "11ee52cc98627368d794968cae8dc2c7abc5b07f",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/cache.go",
      "new_id": "da23186686ba0816aa8ff30acfd25932e618d65c",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/cache.go"
    },
    {
      "type": "modify",
      "old_id": "abb6ba22fa4556471cd2e27c06aa2efabbfadba9",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/check.go",
      "new_id": "62067d4efe3ba48b329b5e5023acc02e03d48b5e",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/check.go"
    },
    {
      "type": "modify",
      "old_id": "395c0e329432d2381024c74a3a04fe0a262707aa",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/mod.go",
      "new_id": "64c50af2c2cea09ef5997c1efadf234b4414d112",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/mod.go"
    },
    {
      "type": "modify",
      "old_id": "5e0c1dbd5c38945ae50865cd60d1644455823a3d",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/mod_tidy.go",
      "new_id": "9ea70786e4fb41e7d137b43486c6c3961def49ed",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/mod_tidy.go"
    },
    {
      "type": "modify",
      "old_id": "b5ce9dff6a48f8ba502f99adbf5f823d91c83c65",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/parse.go",
      "new_id": "1c4c64ac86bb3f21bd5b30719d9632dff0ddd3db",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/parse.go"
    },
    {
      "type": "modify",
      "old_id": "4374eee5e2757d273b9901d61b5b6b50e604cb8f",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/session.go",
      "new_id": "accdae641c110fc2eaa1feafbc7000dc4c2a0b91",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/session.go"
    },
    {
      "type": "modify",
      "old_id": "87c164e6e827e81f716316ab3ca4270f35b61dbf",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/snapshot.go",
      "new_id": "da645c047a17a40b4139285823a02e64fc05be3e",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/snapshot.go"
    },
    {
      "type": "modify",
      "old_id": "c9be6c4d57d2dfa6aaa974104119aa9d004811be",
      "old_mode": 33188,
      "old_path": "internal/lsp/cache/view.go",
      "new_id": "7110e28a9ccbac4d628167a0a374c4b987b6e463",
      "new_mode": 33188,
      "new_path": "internal/lsp/cache/view.go"
    },
    {
      "type": "modify",
      "old_id": "28c8d481a15f2726aeaabf50efc80b7620ec5140",
      "old_mode": 33188,
      "old_path": "internal/lsp/command.go",
      "new_id": "96bdd6ee0db2cade41b2d0ce23dfa80537911b20",
      "new_mode": 33188,
      "new_path": "internal/lsp/command.go"
    },
    {
      "type": "modify",
      "old_id": "ddb8ecfc8c764cbf2832dd7be5b5850565caa7e0",
      "old_mode": 33188,
      "old_path": "internal/lsp/general.go",
      "new_id": "bc367723f748b431be74aa0a7021274052e08d45",
      "new_mode": 33188,
      "new_path": "internal/lsp/general.go"
    },
    {
      "type": "modify",
      "old_id": "579f51da4d9d05c140dfcd817cffded7d51dc90c",
      "old_mode": 33188,
      "old_path": "internal/lsp/lsp_test.go",
      "new_id": "1f12bca98b6573c0f35711dc97b3817d9da9f6d3",
      "new_mode": 33188,
      "new_path": "internal/lsp/lsp_test.go"
    },
    {
      "type": "modify",
      "old_id": "76fce9bb312c6f1f1f70f4da5f11aa25acb5dcce",
      "old_mode": 33188,
      "old_path": "internal/lsp/source/source_test.go",
      "new_id": "8bc69f3ace768e9bc808172edd94a96ddfa59423",
      "new_mode": 33188,
      "new_path": "internal/lsp/source/source_test.go"
    },
    {
      "type": "modify",
      "old_id": "9494f944f02631ad2b7a1de3e2d819793ddcd612",
      "old_mode": 33188,
      "old_path": "internal/lsp/source/view.go",
      "new_id": "d345321347e97fb7a4b96ccc468c271e9cf722d2",
      "new_mode": 33188,
      "new_path": "internal/lsp/source/view.go"
    },
    {
      "type": "modify",
      "old_id": "dc75aee81d8d4707dbb015af0572b4a0866f401c",
      "old_mode": 33188,
      "old_path": "internal/lsp/source/workspace_symbol.go",
      "new_id": "d631cacbb1023e9bbbdfb8d8f6be00f044d29459",
      "new_mode": 33188,
      "new_path": "internal/lsp/source/workspace_symbol.go"
    },
    {
      "type": "modify",
      "old_id": "18b306555017731f3adfbb8cfa485e9ff2574199",
      "old_mode": 33188,
      "old_path": "internal/lsp/workspace.go",
      "new_id": "82b7b077b7eb8137fc08bceb17a23b51c81160bf",
      "new_mode": 33188,
      "new_path": "internal/lsp/workspace.go"
    },
    {
      "type": "modify",
      "old_id": "a5e81f096e7f931fca75672f5a209bcaccb0b450",
      "old_mode": 33188,
      "old_path": "internal/memoize/memoize.go",
      "new_id": "c10dc8e8a51e486100cf2a015c0f1cacb74d0f60",
      "new_mode": 33188,
      "new_path": "internal/memoize/memoize.go"
    },
    {
      "type": "modify",
      "old_id": "00d003a6c4da9fdd8cacd831419d766f81562618",
      "old_mode": 33188,
      "old_path": "internal/memoize/memoize_test.go",
      "new_id": "e6e7b0bc99f485e7c8cd72092617fa4ccb79aae9",
      "new_mode": 33188,
      "new_path": "internal/memoize/memoize_test.go"
    },
    {
      "type": "delete",
      "old_id": "891322599b62666d1d09bc4e7e0dc3a313e85da6",
      "old_mode": 33188,
      "old_path": "internal/memoize/nocopy.go",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    }
  ]
}
