Skip to content

only fetch full user data once

Administrator requested to merge backend-dry-run/cc/get-user-once into main

Created by: camdencheek

We are currently fetching user metadata many times over the course of a request (search u.id in the find bar in this trace). According to Query Insights, it is the 5th most-executed query on sourcegraph.com.

At least three of these (often more) are on the critical path for streaming search latency, so even though they're cheap (<1ms), that adds up to a few additional milliseconds of latency for every request.

This PR modifies the Actor to store the result of a user fetch so this only needs to be done once per request. This felt like the least invasive way to do this since it doesn't require changing any consumers of GetByCurrentAuthUser, but I'm always open to alternatives.

Merge request reports

Loading