Skip to content

Always cache graph attrs for better backend cache behavior - #7455

Merged
rossbar merged 1 commit into
networkx:mainfrom
eriknw:cache_graph_attrs
May 21, 2024
Merged

rossbar merged 1 commit into
networkx:mainfrom
eriknw:cache_graph_attrs

Conversation

@eriknw

@eriknw eriknw commented May 20, 2024

Copy link
Copy Markdown
Contributor

This should slightly optimize caching for little cost. It reduces the number of possible cache keys by half. Also, add a few comments for clarity.

@dschult and @rlratzel this is as we discussed today. @rlratzel, this could be superseded by your idea to have the ability to incrementally update cached graphs via new backend APIs (or maybe using existing functions?).

This should slightly optimize caching for little cost.
It reduces the number of possible cache keys by half.
Also, add a few comments for clarity.

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM.
Clarifies a few sections and simplifies the decision process for checking if the graph has been cached.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well, +1 for any form of simplification + the added comments!

@rossbar
rossbar merged commit 1071e14 into networkx:main May 21, 2024
@jarrodmillman jarrodmillman added this to the 3.4 milestone May 21, 2024
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request May 22, 2024
This should slightly optimize caching for little cost.
It reduces the number of possible cache keys by half.
Also, add a few comments for clarity.
@dschult dschult changed the title Always cache graph attrs for better cache behavior Always cache graph attrs for better backend cache behavior Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants