Skip to content

Commit 548adb9

Browse files
Gusted6543zeripath
authored
Avoid database lookups for DescriptionHTML (#18924)
* Avoid database lookups for `DescriptionHTML` - Don't Compose meta's for DescriptionHTML, they are only needed in order to correctly format and show issue's but it's highly unlikely that a repository description will refer to a local issue. Using 125 Connections for 5 seconds: on `/explore/repos`(which is the most noticeable usage by this function's database lookups): Before: Statistics Avg Stdev Max Reqs/sec 569.41 506.05 2715.00 Latency 214.27ms 16.60ms 294.84ms HTTP codes: 1xx - 0, 2xx - 2974, 3xx - 0, 4xx - 0, 5xx - 0 others - 0 Throughput: 27.17MB/s After: Statistics Avg Stdev Max Reqs/sec 1585.04 789.84 4144.56 Latency 78.89ms 15.89ms 206.94ms HTTP codes: 1xx - 0, 2xx - 7975, 3xx - 0, 4xx - 0, 5xx - 0 others - 0 Throughput: 73.85MB/s Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent 79c7219 commit 548adb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/repo/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ func (repo *Repository) DescriptionHTML(ctx context.Context) template.HTML {
520520
desc, err := markup.RenderDescriptionHTML(&markup.RenderContext{
521521
Ctx: ctx,
522522
URLPrefix: repo.HTMLURL(),
523-
Metas: repo.ComposeMetas(),
523+
// Don't use Metas to speedup requests
524524
}, repo.Description)
525525
if err != nil {
526526
log.Error("Failed to render description for %s (ID: %d): %v", repo.Name, repo.ID, err)

0 commit comments

Comments
 (0)