Skip to content

Commit

Permalink
Add benchmark for urlize. (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahboyce authored Dec 12, 2024
1 parent 54177a0 commit fb0523b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions benchmarks/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"benchmarks",
"benchmarks.template_benchmarks.template_render",
"benchmarks.template_benchmarks.template_compilation",
"benchmarks.template_benchmarks.template_tag_urlize",
"benchmarks.query_benchmarks.query_annotate",
"benchmarks.query_benchmarks.query_all_conv",
"benchmarks.query_benchmarks.query_complex_filter",
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions benchmarks/template_benchmarks/template_tag_urlize/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.template.defaultfilters import urlize

from ...utils import bench_setup


class Urlize:
def setup(self):
bench_setup()

def time_urlize(self):
urlize("Django. " * 100)
urlize("https://www.djangoproject.com/ " * 100)

0 comments on commit fb0523b

Please sign in to comment.