Opened 13 years ago
Last modified 12 years ago
#9870 closed enhancement
Improve the cache subsystem — at Initial Version
Reported by: | Remy Blank | Owned by: | Remy Blank |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | general | Version: | 0.12dev |
Severity: | normal | Keywords: | cache |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
#9866 got me thinking about the cache subsystem, and there are at least two issues that could be improved:
CachedProperty
currently usesinstance.__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.
Note:
See TracTickets
for help on using tickets.