Skip to content

LSIF: nearest commit can take 0.5s to execute on every request

Created by: chrismwendt

The recursive CTE that finds the nearest commit appears to be linear in the commit distance at a rate of about 0.5ms/commit (e.g. 95 commits away from LSIF data, the query took 393ms).

Since that query runs on every query, I think it's worth caching the results (invalidating all entries for the same repository whenever a new LSIF dump is uploaded).

https://github.com/sourcegraph/sourcegraph/blob/603ce95e1374b63d98868cdebd02f37d4f19a922/lsif/src/xrepo.ts#L118