Skip to content

Add benchmark for Q.create()#98

Draft
amakarudze wants to merge 2 commits intodjango:mainfrom
amakarudze:q-create
Draft

Add benchmark for Q.create()#98
amakarudze wants to merge 2 commits intodjango:mainfrom
amakarudze:q-create

Conversation

@amakarudze
Copy link
Copy Markdown

Added a benchmark for Q.create() in benchmarks/query_benchmarks/query_utils_q_create to be used in Ticket 36912.

@amakarudze amakarudze marked this pull request as draft March 29, 2026 16:38
Content.objects.all().delete()

def time_q_create(self):
content_list = list(Content.objects.all())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! A quick note here. I'm not so familiar with how django-asv works, but it looks like this database call is in the snippet being benchmarked. I think your benchmark needs to ensure it only calls Q() or Q.create().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants