Prior to this patch, a typical /patch// query for linuxppc-dev
(which has about half a dozen checks per patch) took around 20 queries
and 16.5ms in the database. About half of those queries were fetching
the checks and who did the check.
We can just do one query to get all that needed information, so we do
that. This brings a page load down to 10 queries in 12ms.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
>{{ submission.pull_url }}</a>
{% endif %}
-{% if submission.checks %}
+{% if checks %}
<h2>Checks</h2>
<table class="checks">
<tr>
<th>Check</th>
<th>Description</th>
</tr>
-{% for check in submission.checks %}
+{% for check in checks %}
<tr>
<td>{{ check.user }}/{{ check.context }}</td>
<td>
context['comments'] = comments
context['all_series'] = patch.series.all().order_by('-date')
+ context['checks'] = patch.check_set.all().select_related('user')
context['submission'] = patch
context['patchform'] = form
context['createbundleform'] = createbundleform