Commit a6a326e5 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Add django_tiny microbenchmark

parent 0afbff14
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../test/integration/django"))
from django.conf import settings
settings.configure()
from django.template import Context, Template, Node
import time
DJANGO_TMPL = Template("""
{{ col|escape }}
""".strip())
def test_django():
table = [xrange(50) for _ in xrange(50)]
context = Context({"table": table, 'col': 1})
times = []
node = DJANGO_TMPL.nodelist[0]
context.push()
for _ in xrange(100000):
node.render(context)
context.pop()
return times
test_django()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment