Skip to content

perf: Do not unnecessarily load patches.diff from DB

Administrator requested to merge campaigns/diffstat-without-diff into master

Created by: mrnugget

Most of the time when we load patches from the database we don't need to load the diff column, since we're mainly interested in foreign keys or the diff stat columns.

Since the diffs can get pretty big, it makes sense to only load them when necessary.

By not loading them, we should get a speed bump and use less memory for requests in which we're really only interested in the other columns (e.g. when we calculate the diff stat).

This should fix #11126.


@sourcegraph/campaigns on a scale from "meh, I can live with it" to "if you merge this, I'm going to throw up": how bad do you think the strings.Replace is?

Merge request reports

Loading