Templates can only be made based on String; it would almost certainly be possible to get better performance by using a lazy bytestring or Text, and that performance would be useful when trying to maintain large websites with Hakyll.
I have some experience in this matter and I am convinced that this is not the main bottleneck for typical Hakyll sites. Pandoc usually takes up most time and gives us only a String type to work with.
Although, if you have a template-heavy site, I'd be glad to take a look at it and see if I can improve performance one way or another.
It may be that the site I'm working on is atypical, but part of it involves processing thousands of HTML files produced by Doxygen and applying a template consistent with the rest of the site to them. Pandoc is not involved in the process.
I have been time and heap profiling and found a number of issues:
Because I don't use Pandoc for the Doxygen output (it is HTML already), I could in theory not have the data pass through String at all. I am going to attempt an alternative template implementation that uses ByteStrings and compare profiling results to see how it goes.
Okay, in that case it makes a lot of sense! Instead of using the simple templates that come with Hakyll, it might be worth looking at blaze-html (which Hakyll can also use).