mirror of
https://github.com/wrabit/django-cotton.git
synced 2025-07-19 15:35:04 +00:00
with merge confs fixed
This commit is contained in:
commit
ab1a98052d
12 changed files with 215 additions and 130 deletions
|
@ -27,31 +27,17 @@ settings.configure(
|
|||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
],
|
||||
"loaders": [
|
||||
(
|
||||
"django.template.loaders.cached.Loader",
|
||||
[
|
||||
"django_cotton.cotton_loader.Loader",
|
||||
"django.template.loaders.filesystem.Loader",
|
||||
"django.template.loaders.app_directories.Loader",
|
||||
],
|
||||
)
|
||||
],
|
||||
"builtins": [
|
||||
"django.templatetags.static",
|
||||
"django_cotton.templatetags.cotton",
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
COTTON_TEMPLATE_CACHING_ENABLED=True,
|
||||
COTTON_TEMPLATE_CACHING_ENABLED=False,
|
||||
DEBUG=False,
|
||||
)
|
||||
|
||||
django.setup()
|
||||
|
||||
|
||||
def template_bench(template_name, iterations=10000):
|
||||
def template_bench(template_name, iterations=500):
|
||||
start_time = time.time()
|
||||
for _ in range(iterations):
|
||||
render_to_string(template_name)
|
||||
|
@ -59,7 +45,7 @@ def template_bench(template_name, iterations=10000):
|
|||
return end_time - start_time, render_to_string(template_name)
|
||||
|
||||
|
||||
def template_bench_alt(template_name, iterations=10000):
|
||||
def template_bench_alt(template_name, iterations=500):
|
||||
data = list(range(1, iterations))
|
||||
start_time = time.time()
|
||||
render_to_string(template_name, context={"data": data})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue