Skip to content

codeintel: Add a request-level data cache

Created by: efritz

Jaeger traces are showing that definitions, hovers and (to a greater extent) reference resolvers will often request and decode the same query from the lsif store multiple times during the flow of one request. We can likely increase the performance (and reduce pressure from postgres) by adding a fresh cache initialized on each request that will hold (and synchronize access to) decoded payloads. This is similar to what we do for chained resolvers in the codeintel graphql layer already.

This is an orthogonal effort to https://github.com/sourcegraph/sourcegraph/issues/15945; this effort will add caching where batching is not possible (requesting the same document from a hover and definition resolver in the same request, which is very common).