#36912: Q.create() doesn't validate connectors as Q.__init__() does
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Anna
Type: | Makarudze
Cleanup/optimization | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: _connector security | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Anna Makarudze):
Hey Jacob, just an update.
I was having a discussion with Tim Schilling, and he suggested that I
investigate the following:
Is the original reason for Q.create() still valid? The docstring on
tree.Node.create() indicates the signatures were different between
Q.__init__() and Q.create() hence the reason for the extra method. It
looks like they are slightly different, but the biggest difference is in
the unpacking and the sort() call.
Is there a performance difference if we swap out all Q.create() usages
with Q() instead. This could be determined by creating a commit to Django
that uses that (confirm the tests pass), then using that with django-asv
to compare performance
What is the performance impact of calling [*args, *sorted(kwargs.items())]
in Q.__init__()? This could be calculated in a script. This is where AI
can be helpful. I used Claude to generate a script that provided a
framework to tweak options to better understand the impact of that:
https://claude.ai/share/d7af3307-58c8-4c91-af82-0d30d0571dfc
I investigated the 2nd scenario only with django-asv and the benchmarks
indicated better performance for Q() than Q.create(). I didn't go ahead
with creating a commit to Django using that method. I will be
investigating 1 and 3 this week. Any thoughts or insights on how to tackle
this ticket?
--
Ticket URL: <https://code.djangoproject.com/ticket/36912#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019d3ae59499-5f0a0376-11d8-4cf0-93c8-29f5706156c5-000000%40eu-central-1.amazonses.com.