A few weeks ago, we announced that we would be upgrading our templating language from Django to Jinja and discussed some of the reasons for doing so. At the time we promised a follow-up with more depth on the technical details. Today we’re here to fulfill that promise.
As mentioned previously, the three big reasons we’re upgrading to Jinja are that it’s highly extensible, fast, and easy to sandbox. We also considered Genshi and Mako, but eventually landed on Jinja because, in addition to fulfilling our criteria, Jinja had the advantage of being based on Django. This meant that it already rendered almost all of our Django templates correctly from the get go and wouldn’t require as much work to migrate everyone over.
Clearly Jinja has a lot to offer, but today we want to focus on the performance advantages, so let’s get benchmarking!