#35270: Optimize Model._meta._property_names -------------------------------------+------------------------------------- Reporter: Adam Johnson | Owner: Adam Type: | Johnson Cleanup/optimization | Status: assigned Component: Database layer | Version: dev (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: | Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Keryn Knight):
* cc: Keryn Knight (added) Comment: 👋 Adam, do you happen to know the overall percentage of the "win" each of the 2 optimisations does? i.e. is 80% of it the change to use the `klass.__dict__` or is 95% of it the `weak_key_cache`, etc? Is there a world where we get enough of a benefit from ''just'' `Changing the function to use __dict__ directly ` that we don't need the `weak_key_cache`? I ask because the `weak_key_cache` is the kind of deep magic that **I** don't fully understand immediately, and because you mentioned caching on a ''per-class basis'' but I'd have ''assumed'' (from my naive understanding of these innards) that was already approaching done, by virtue of the `cached_property` existing on the `Options` per model? (i.e. `Options` is a singleton per class) -- Ticket URL: <https://code.djangoproject.com/ticket/35270#comment:3> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018e13ab44fb-e2c62859-1b9a-49cb-83b4-1f4d976b4357-000000%40eu-central-1.amazonses.com.