The question is something like a meaningless one. Templates will always be slower than a manually configured rendering solution, but template tags should still go through the Template mechanism, so you lose any advantage there. If you want super-high performance, consider writing all HTML as an array of Python strings, concatenate () them once, and then pass your HTML back as the body of an HTTPResponse object.
Or you can try all three and profile them. Since we do not know your code, we will not be able to work with you. After several experiments, you should be satisfied with which approach suits you.
Template engine is almost never your bottleneck. Your database is the most likely bottleneck. You have a Django toolbar, right? If the template system has no performance issues, always use the solution that will be the cheapest for you.
source share