Opened 4 weeks ago

Last modified 4 weeks ago

#36977 assigned Cleanup/optimization

Cache more expression `output_field` properties

Reported by: Adam Johnson Owned by: Adam Johnson
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Many expression classes use @cached_property on output_field to avoid recomputation, such as `ST_Polygon` and `Lookup`. However, the opportunity has been missed in some expression classes.

Change History (6)

comment:1 by Adam Johnson, 4 weeks ago

Has patch: set

comment:2 by Elias Stinson, 4 weeks ago

Cc: Elias Stinson added
Needs documentation: set
Patch needs improvement: set

Before I mark the triage as accepted, what exact computed classes will the patch cache? Just need a bit more info before I can mark this as accepted. However, I do agree that this should be added if you provide a clear outline of what exact computed class(es) will be cached, and how you will modify it. I'll CC myself so I can see if you provide that info, and furthermore will accept it in that case.

comment:3 by Adam Johnson, 4 weeks ago

See the linked PR.

comment:4 by Elias Stinson, 4 weeks ago

Ok! Will do!

comment:5 by Elias Stinson, 4 weeks ago

Cc: Elias Stinson removed
Needs documentation: unset
Patch needs improvement: unset
Triage Stage: UnreviewedReady for checkin

After reviewing the PR, I will mark this for checkin, as it is clearly defined what classes are being optimized, and a pr has already been created, and has been reviewed! Also, removing myself as CC just because now it's up to the django maintainers to implement the patch, and no further involvement from me is needed!

comment:6 by Jacob Walls, 4 weeks ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Elias, community triage is welcome (thank you!), but I would advise tackling fewer issues at first until you get the hang of things. For instance, this one isn't ready for checkin because there are changes requested on the PR.

Note: See TracTickets for help on using tickets.
Back to Top