Changes between Initial Version and Version 3 of Ticket #35241


Ignore:
Timestamp:
Feb 22, 2024, 3:15:18 PM (7 months ago)
Author:
Adam Johnson
Comment:

I added concrete numbers to the description.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35241

    • Property Triage Stage UnreviewedAccepted
    • Property Patch needs improvement set
  • Ticket #35241 – Description

    initial v3  
    33`Model._meta.get_parent_list()` computes the flattened list of ancestor models by MRO. This list is immutable, deterministic, and recursively constructed through the inheritance hierarchy. These properties make it a prime candidate for caching.
    44
    5 I found this method was taking ~1% of the total runtime for system checks on a project with 118 models. After adding caching, it’s reduced to a negligible amount.
     5I found this method was taking ~1% (0.39ms) of the total runtime for system checks on a project with 118 models. After adding caching, it’s reduced to a negligible amount (<0.01ms).
    66
    77`get_parent_list()` is called in many other code paths, so caching will help all of those too.
Back to Top