Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-07-07 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.658c2699759a16fd2f204f7307790652%40djangoproject.com.


Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-07-07 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by GitHub ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"5013798fe9a87b693ddb5589a8a408a04a873781" 5013798f]:
 {{{
 #!CommitTicketReference repository=""
 revision="5013798fe9a87b693ddb5589a8a408a04a873781"
 Fixed #32840 -- Optimized Field.get_col().

 get_col() used "self" as "output_field" when it was not given, and
 unnecessarily compared "self" to "self".

 Co-authored-by: Chris Jerdonek 
 Co-authored-by: Mariusz Felisiak 
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.be53b0d54ad7dbdf4dc240a0639621b7%40djangoproject.com.


Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-07-06 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * needs_better_patch:  0 => 1


Comment:

 Updating state based on initial review on the PR.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.da4eed4d4dc0e8f8c78dd5522ac8c25c%40djangoproject.com.


Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-07-02 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * has_patch:  0 => 1


Comment:

 PR is here: https://github.com/django/django/pull/14585
 For consistency across 2 separate comment areas:

 The reason I've not opted for the suggested alternative above (and have
 instead kept my rough original proposal) is not a criticism of it, but for
 keeping intent as clear as possible -- the version which was suggested
 relies on the mental parsing of the `x or y` twice (which always causes
 ''me'' to double take) and leaves open an accidental regression in the
 future should someone justify an implementation of `Field.__bool__` which
 is equally/more costly as `Field.__eq__` (I think).

 (Obviously I can change that stance, if it's even deemed worthwhile doing
 it. We'll see)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.a746fc80a92213ef975c7eb97ecf2197%40djangoproject.com.


Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-07-02 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * owner:  nobody => Keryn Knight
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.db0ffdba81d6cd2532bc7c5aacec2f8d%40djangoproject.com.


Re: [Django] #32840: Micro-optimisation possibility in Field.get_col

2021-06-15 Thread Django
#32840: Micro-optimisation possibility in Field.get_col
-+-
 Reporter:  Keryn Knight |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Accepted


Comment:

 Hi Keryn, thanks. I'm going to provisionally Accept this to let
 Mariusz/Simon have a look at it in PR.

 I wonder if we need the initial conditional at all... 樂

 Untested, but same idea I think:

 {{{
 def get_col(self, alias, output_field=None):
 if alias != self.model._meta.db_table or (output_field and
 output_field != self):
 from django.db.models.expressions import Col
 return Col(alias, self, output_field or self)
 else:
 return self.cached_col
 }}}


 > I'm purposefully avoiding making further investigation/judgement about
 whether output_field != self is itself necessary, because it's ostensibly
 possible for a custom output_field to be provided which has the same
 creation_counter + model and I don't know how likely that is.

 Yes.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.ac5d0b5a37298f85a9ee772007ac7b0b%40djangoproject.com.