Improve the cache subsystem
|Reported by:||Remy Blank||Owned by:||Remy Blank|
Improved behavior and documentation for
It is now safe to inherit from classes having
#9866 got me thinking about the cache subsystem, and there are at least two issues that could be improved:
instance.__class__to determine the module and class names. This is not correct when a component is subclassed, as seems to be the case e.g. in Agilo. This means that a cached property defined in an abstract base component, and inherited by sub-components, will have a different id in every subclass, and hence invalidating in one subclass will not invalidate the cached value in the other subclasses.
- Using a string identifier as a property id in the database was a pretty silly idea in retrospect. An integer hash of the identifier would be more space and time-efficient. Collisions are not an issue, as the only effect would be to invalidate slightly more than necessary.
The first issue is a bug, so I would like to fix it in 0.12-stable. The solution for the first item is to use the class where the property is defined to determine the module and class names.
The second is an enhancement that requires a DB upgrade, so I will implement it on trunk.