Skip to content
  • Jean Boussier's avatar
    514d4748
    Fix a performance regression in attribute methods · 514d4748
    Jean Boussier authored
    Fix: #52111
    Fix: 5dbc7b42
    
    The above commit caused the size of the `CodeGenerator` method cache
    to explode, because the dynamic namespace is way too granular.
    
    But there is actually a much better fix for that, since `alias_attribute`
    is now generating exactly the same code as the attribute it's aliasing,
    we can generated it as the canonical method in the cache, and then just
    define it in the model as the aliased name.
    
    This prevent the cache from growing a lot, and even reduce memory
    usage further as the original attribute and its alias now share
    the same method cache.
    514d4748
    Fix a performance regression in attribute methods
    Jean Boussier authored
    Fix: #52111
    Fix: 5dbc7b42
    
    The above commit caused the size of the `CodeGenerator` method cache
    to explode, because the dynamic namespace is way too granular.
    
    But there is actually a much better fix for that, since `alias_attribute`
    is now generating exactly the same code as the attribute it's aliasing,
    we can generated it as the canonical method in the cache, and then just
    define it in the model as the aliased name.
    
    This prevent the cache from growing a lot, and even reduce memory
    usage further as the original attribute and its alias now share
    the same method cache.
Loading