Skip to content

Commit

Permalink
Added system check benchmark (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Feb 24, 2024
1 parent ad13808 commit 8145e27
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
10 changes: 7 additions & 3 deletions benchmarks/query_benchmarks/queryset_filter_chain/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ def time_filter_chain(self):
Book.objects.filter(title="Talent").filter(
description__icontains="top performers"
).filter(author_name__startswith="Geoff").filter(
date_created__lt=datetime.datetime(year=2010, month=1, day=1)
date_created__lt=datetime.datetime(
year=2010, month=1, day=1, tzinfo=datetime.timezone.utc
)
).filter(
date_created__gte=datetime.date(year=2007, month=1, day=1)
date_created__gte=datetime.datetime(
year=2007, month=1, day=1, tzinfo=datetime.timezone.utc
)
).filter(
date_published=datetime.datetime.now()
date_published=datetime.datetime.now(tz=datetime.timezone.utc)
).filter(
enabled=True
)
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions benchmarks/system_check_benchmarks/run_checks/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.core.checks import run_checks

from ...utils import bench_setup


class SystemChecks:
def setup(self):
bench_setup(migrate=True)

def time_checks(self):
run_checks(include_deployment_checks=True, databases=("default",))

0 comments on commit 8145e27

Please sign in to comment.