2 from cProfile import Profile
4 from profile import Profile
5 from pstats import Stats
6 from jinja2 import Environment as JinjaEnvironment
9 'page_title': 'mitsuhiko\'s benchmark',
10 'table': [dict(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10) for x in range(1000)]
13 jinja_template = JinjaEnvironment(
14 line_statement_prefix='%',
15 variable_start_string="${",
16 variable_end_string="}"
21 <title>${page_title|e}</title>
25 <h1>${page_title|e}</h1>
27 <ul class="navigation">
28 % for href, caption in [
29 ('index.html', 'Index'),
30 ('downloads.html', 'Downloads'),
31 ('products.html', 'Products')
33 <li><a href="${href|e}">${caption|e}</a></li>
53 p.runcall(lambda: jinja_template.render(context))
55 stats.sort_stats('time', 'calls')