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

Sensitivity analysis: add a bus cache to improve input handling perfomance #298

Merged
merged 3 commits into from
May 3, 2021

Conversation

sylvlecl
Copy link
Contributor

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest

Quck win for #296

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Perf improvement

What is the current behavior? (You can also link to an open issue here)

Buses may be searched for multiple times in the network.

What is the new behavior (if this is a feature change)?

Buses are searched only once and cached.

On the use case described in the issue, the computation time reduces from ~25s to ~8s

…rmance

Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
@sylvlecl sylvlecl requested a review from annetill April 29, 2021 14:05
@annetill annetill requested a review from flo-dup April 29, 2021 14:13
@sylvlecl sylvlecl changed the title Sensitivity analysis: add a bus cache to improve input handling perfomance WIP: Sensitivity analysis: add a bus cache to improve input handling perfomance Apr 29, 2021
@sylvlecl
Copy link
Contributor Author

Do not merge yet: I think it will be slightly better to build the full cache once from the start (otherwise we still perform a linear search once for each bus). I will check it.

Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
@sylvlecl sylvlecl changed the title WIP: Sensitivity analysis: add a bus cache to improve input handling perfomance Sensitivity analysis: add a bus cache to improve input handling perfomance Apr 30, 2021
@sylvlecl
Copy link
Contributor Author

Do not merge yet: I think it will be slightly better to build the full cache once from the start (otherwise we still perform a linear search once for each bus). I will check it.

So indeed after some tests, building the full cache on first call does not cost much and scales much better (50s for full computation vs 1min30, on large network for sensitivities of buses to all generators).

Copy link
Contributor

@flo-dup flo-dup left a comment

Choose a reason for hiding this comment

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

I preferred previous commit in a way, as it avoids computing the full map in the case of having only a few buses for which we want to compute the voltage. But as you said, last one scales up better and we're looking for a quick win here.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@annetill annetill merged commit 8fff3af into master May 3, 2021
@annetill annetill deleted the sensi-bus-cache branch May 3, 2021 06:48
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.

3 participants