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

Sankey: cache results #1112

Closed
marc-vdm opened this issue Nov 8, 2023 · 0 comments · Fixed by #1117
Closed

Sankey: cache results #1112

marc-vdm opened this issue Nov 8, 2023 · 0 comments · Fixed by #1117
Assignees
Labels
feature Issues/PRs related to a new feature

Comments

@marc-vdm
Copy link
Member

marc-vdm commented Nov 8, 2023

Feature request

It is likely users are switching back and forth between different functional units and impact categories when looking at the Sankey. As calculation takes time, we should cache the results (for combo of specific FU, IC, scenario, cutoff and iterations) and check if results are in cache before calculating them.

The results are only a small JSON every time, so the cache shouldn't take much space, while this can make AB feel significantly faster in use.

See below for a similar implementation of caching in #1046.

class ProductContributionsTab(ContributionTab):

In the future we may look at the actual graph traversal calculations and see if we can already provide it with previously cached results to calculate less, but this would be much more complex. e.g. when a calculation is run where the cutoff is lowered to 3% from 5%, so we can take the results from the 5% and then calculate to the lower cutoff from there.

@marc-vdm marc-vdm added the feature Issues/PRs related to a new feature label Nov 8, 2023
@marc-vdm marc-vdm self-assigned this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues/PRs related to a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant