Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cached properties by reducing number of them #115

Open
hagenw opened this issue Oct 21, 2024 · 1 comment
Open

Improve cached properties by reducing number of them #115

hagenw opened this issue Oct 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@hagenw
Copy link
Member

hagenw commented Oct 21, 2024

The code can be made easier by using a few ground truth cached properties, from which then all other properties could be derived. So far we did not follow this approach to avoid storing large quantities in the cache (e.g. we don't need the whole header).
But this can be avoided, by first extracting all information, that we need and store them inside a dictionary and then access the dict entries in other properties, which we don't need to cache.

To make all needed properties available in Datacard, we need to add a new _properties() method and use those in Datacard, insteaf of _cached_properties().

@hagenw hagenw added the enhancement New feature or request label Oct 21, 2024
@hagenw
Copy link
Member Author

hagenw commented Oct 21, 2024

E.g. instead of having _segments, _tables_stats, tables_columns, tables_preview, tables_rows, segments, segment_durations as cached properties, we could replace it by a single _parse_tables cached property, which then returns a dict with entries for all the other properties that need table information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant