-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix non linear shunt conversion performances issue #3218
Conversation
e04b8a0
to
c78b224
Compare
864a514
to
f8226eb
Compare
PropertyBags shuntCompensatorPoints(); | ||
|
||
// Non-linear shunt compensator points grouped by shunt compensator | ||
Map<String, PropertyBags> groupedShuntCompensatorPoints(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this method should be exposed in the API instead of the old nonlinearShuntCompensatorPoints(String id)
method.
When we look at the usage, the new method is always called to retrieve the data for a single id and it is not trivial to refactor the code to call the method only once for all the IDs.
So I think this method is more an implementation detail of CgmesModelTripleStore
.
Note that using the new method also introduces breaking changes that are not really needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Providing this method makes the API of the CGMES model consistent with other cached data, like grouped transformer ends. The only implementation of the CGMES model is the one based in the triple store (apart from the fake one used in some unit tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll refactor the other methods to have a consistent behaviour:
Provide in the API (CgmesModel) the methods:
- PropertyBags xxx() that should return all data (e.g. returns all PowerTransformerEnd)
- PropertyBags xxx(String commonObjectId) that should return the data for a specific commonObjectId (e.g. returns the PowerTransformerEnd for a specific PowerTransformer id)
In the implementation (AbstractCgmesModel) have the same methods where:
- PropertyBags xxx() runs the query
- PropertyBags xxx(String commonObjectId) that:
- If called for the 1st time runs the full query, builds a Map and caches it
- Returns the PropertyBags associated to commonObjectId from the cached Map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seen with @rcourtier:
- The
nonlinearShuntCompensatorPoints(String id)
was restored andgroupedShuntCompensatorPoints()
is no more exposed in theCgmesModel
interface. - A general refactoring of
CgmesModel
, providing more consistency, will be done in another PR.
…LinearShuntCompensator in order to improve performances Signed-off-by: Romain Courtier <romain.courtier@rte-france.com>
Signed-off-by: Romain Courtier <romain.courtier@rte-france.com>
Signed-off-by: Romain Courtier <romain.courtier@rte-france.com>
Signed-off-by: Romain Courtier <romain.courtier@rte-france.com>
a1b2997
to
881e15c
Compare
|
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Fix performances issue.
What is the current behavior?
Query of cim:NonlinearShuntCompensatorPoint is slow as it is using a FILTER clause which isn't good performance wise.
What is the new behavior (if this is a feature change)?
Query and java code have been rewritten to convert nonLinearShuntCompensatorPoint without using the FILTER clause, thus improving the performances.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Breaking change:
Interface
CgmesModel
has a new method that should be implemented if you have classes implementing this interface:PropertyBags nonlinearShuntCompensatorPoints()
Other information:
Time of CGMES import of activsg70k grid has been reduced by 25%.