How to make Hugo faster?

The problem seems to be in my sidebar.html file. With that partial enabled:

208 of 208 drafts rendered
0 future content
214 pages created
0 paginator pages created
29 categories created
3 tags created
in 5660 ms

Without that partial:

208 of 208 drafts rendered
0 future content
214 pages created
0 paginator pages created
29 categories created
3 tags created
in 576 ms

In sidebar.html I use several loops to generate an alphabetically list of all posts in a category. I do that like this:

{{ range $.Site.Pages.ByTitle }}
  {{ if and (in .Params.categories "Category") (in .Params.categories "sub-category") }}
    <li><a href="{{ .Permalink }}">{{ .Title }}</a>
        {{ if .Draft }} * {{ end }}</li>
  {{ end }}
{{ end }}

Is there perhaps an error in that approach or can I change it to make it run more efficient?