)]}'
{
  "commit": "ae05609bd034f8eb7ded41b73e6af55c77b0d983",
  "tree": "07def0961e75a01f10f11f17f3fcd583c2f7dfaa",
  "parents": [
    "de54582dcdd822706d853f5f7353b05aea448cc9"
  ],
  "author": {
    "name": "Robert Findley",
    "email": "rfindley@google.com",
    "time": "Sun Feb 19 21:14:18 2023 -0500"
  },
  "committer": {
    "name": "Robert Findley",
    "email": "rfindley@google.com",
    "time": "Fri Mar 03 22:59:25 2023 +0000"
  },
  "message": "internal/lsp/cache: add an LRU parse cache\n\nAs work proceeds on incremental type-checking, two observations have\nemerged from benchmarking:\n- Using a global FileSet is impossible, as IImportShallow allocates a\n  large number of new token.Files (in early experiments 75%+ of in-use memory\n  was consumed by the FileSet!)\n- Several benchmarks regressed with incremental type-checking due to\n  re-parsing package files following a change. Ideally after a single file\n  changes we would be able to re-typecheck packages containing that file\n  after only re-parsing the single file that changed.\n\nThese observations are in tension: because type-checking requires that\nparsed ast.Files live in the same token.FileSet as the type-checked\npackage, we cannot naively save the results of parsing and still use a\npackage-scoped FileSet.\n\nThis CL seeks to address both observations, by introducing a new\nmechanism for caching parsed files (a parseCache) that parses files in a\nstandalone FileSet offset to avoid collision with other parsed files.\nThis cache exposes a batch API to parse multiple files and return a\nFileSet describing all of them.\n\nBenchmarking indicates that this partially mitigates performance\nregressions without sacrificing the memory improvement we by avoiding a\nglobal cache of parsed files.\n\nIn this CL the parse cache is not yet integrated with type-checking, but\nreplaces certain call-sites where we previously tried to avoid parsing\nthrough the cache.\n\nFor golang/go#57987\n\nChange-Id: I840cf003db835a40721f086abcc7bf00486b8108\nReviewed-on: https://go-review.googlesource.com/c/tools/+/469858\nReviewed-by: Alan Donovan \u003cadonovan@google.com\u003e\nTryBot-Result: Gopher Robot \u003cgobot@golang.org\u003e\ngopls-CI: kokoro \u003cnoreply+kokoro@google.com\u003e\nRun-TryBot: Robert Findley \u003crfindley@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "edefa4325eaa81df91d7168f10f05b5fe3aff85b",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/check.go",
      "new_id": "adf50b6ed4575acc914c3d3a1d9baec8b368234a",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/check.go"
    },
    {
      "type": "modify",
      "old_id": "def10d55fb61019b05206f3001999da48cb0200c",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/mod_tidy.go",
      "new_id": "0572e9d5c711033ad1ed6c28b8c924fca60f6094",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/mod_tidy.go"
    },
    {
      "type": "modify",
      "old_id": "1f90be20b35c0a10b49b6b43880a133adc75f217",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/parse.go",
      "new_id": "f9bf7d76c33858b9efe198b27f2a2e8c3c74a84c",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/parse.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "91ca091c070a1af9b1c98e5bb0a2a288609de90b",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/parse_cache.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "97bff8768c20dfd4d08a2b7b3f92e845446bf77c",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/parse_cache_test.go"
    },
    {
      "type": "modify",
      "old_id": "5df540e4f614aeab17ba8596e3f6797bba33d793",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/session.go",
      "new_id": "38e28acd7df78d1712c7b20bbb13f5a5e8dcdd98",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/session.go"
    },
    {
      "type": "modify",
      "old_id": "f93247af222883c4583b1c07ce2e3781c6bc23a6",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/snapshot.go",
      "new_id": "7ad32554fea73a42494546a0619ff0ab40423386",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/snapshot.go"
    },
    {
      "type": "modify",
      "old_id": "7fa3584d5d6237404f8930be0fdbb164b8da0cb0",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/cache/symbols.go",
      "new_id": "b6ffffb3addd044ca14db3054cd66e27cba4026a",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/cache/symbols.go"
    },
    {
      "type": "modify",
      "old_id": "3902b184d02d005c144e50a38f62dee515ad550e",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/command.go",
      "new_id": "e6ec67f6a6981005683dfb1e7044242f6eb6818a",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/command.go"
    },
    {
      "type": "modify",
      "old_id": "10120c2e1ceb28ee55a69abbe24c4c3b60ef134f",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/source/format.go",
      "new_id": "b8206edc9981b5edf3531e5e19f071e081c3185d",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/source/format.go"
    },
    {
      "type": "modify",
      "old_id": "cc4d37ba8d34870158feac4e8907cd032d473d6f",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/source/hover.go",
      "new_id": "25d85b48eab281fb7867bc5a99218bd3da7578ce",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/source/hover.go"
    },
    {
      "type": "modify",
      "old_id": "184fa9d033db973ddbbefbb09eb08ac50bda0f5b",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/source/stub.go",
      "new_id": "31d8135aa3eab46eac6e610699e9038f3ca69bc4",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/source/stub.go"
    },
    {
      "type": "modify",
      "old_id": "318fab502093e3206f6237a6c263b9548798ea67",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/source/types_format.go",
      "new_id": "4d487d42d08908d1e20ea88d81f8cecb04af9733",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/source/types_format.go"
    },
    {
      "type": "modify",
      "old_id": "1dc78600af232deab5b18760ae28210342c3af65",
      "old_mode": 33188,
      "old_path": "gopls/internal/lsp/source/util.go",
      "new_id": "4149cea4821ce1945e86936aea2121ad5e7e78fc",
      "new_mode": 33188,
      "new_path": "gopls/internal/lsp/source/util.go"
    }
  ]
}
