Skip to content

Commit cbdd8d0

Browse files
committed
Add benchmark for urlize.
1 parent 595a058 commit cbdd8d0

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

benchmarks/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"benchmarks",
1616
"benchmarks.template_benchmarks.template_render",
1717
"benchmarks.template_benchmarks.template_compilation",
18+
"benchmarks.template_benchmarks.template_tag_urlize",
1819
"benchmarks.query_benchmarks.query_annotate",
1920
"benchmarks.query_benchmarks.query_all_conv",
2021
"benchmarks.query_benchmarks.query_complex_filter",

benchmarks/template_benchmarks/template_tag_urlize/__init__.py

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.template.defaultfilters import urlize
2+
3+
from ...utils import bench_setup
4+
5+
6+
class Urlize:
7+
def setup(self):
8+
bench_setup()
9+
10+
def time_urlize(self):
11+
urlize("Django. " * 100)
12+
urlize("https://www.djangoproject.com/ " * 100)

0 commit comments

Comments
 (0)