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

refactor: use immutable objects #199

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

bram-bezem
Copy link
Contributor

@bram-bezem bram-bezem commented Jul 18, 2024

The current implementation uses a mutable data structure (ClusterData) that is passed to several functions and modified. For developers not familiar with code this can be difficult to trace since fields can be set or modified many places in the code.

This change makes use of records and unmodifiable maps to ensure state is not modified after creation.

Performance wise this change has no discernible impact, I have run it along side the current released version against the same cluster
Screenshot_18-7-2024_125053_prometheus bramb-k3a-lag-export-test apps stas-test statnett no

The current implementation uses a mutable data structure (ClusterData)
that is passed to several functions and modified. For developers not
familiar with code this can be difficult to trace since fields can be
set or modified many places in the code.

This change makes use of records and unmodifiable maps to ensure state
is not modified after creation.
@bram-bezem bram-bezem requested a review from a team as a code owner July 18, 2024 10:45
Copy link
Contributor

@sverrehu sverrehu left a comment

Choose a reason for hiding this comment

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

Sweet!

@sverrehu sverrehu merged commit efea4b6 into statnett:main Jul 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants