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

Add parameter in NetworkSerDe.copy to choose between formats (xml, binary, etc.) #3132

Merged
merged 7 commits into from
Sep 24, 2024

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Sep 5, 2024

Please check if the PR fulfills these requirements

  • 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?
No

What kind of change does this PR introduce?
Feature

What is the current behavior?
NetworkSerDe.copy currently uses XML format to import/export the network.

What is the new behavior (if this is a feature change)?
A new NetworkSerDe.copy taking an additional parameter is introduced. This new parameter TreeDataFormat format allows to specify the format to import/export the network.
Using the new parameter with TreeDataFormat.JSON or TreeDataFormat.BIN as a value, it takes less time to copy network of various sizes:

Network size Time with TreeDataFormat.XML Time with TreeDataFormat.JSON Time with TreeDataFormat.BIN
Very small 7.1 ms 3.9 ms 2.4 ms
Small 351 ms 180 ms 170 ms
Medium 784 ms 412 ms 267 ms
Big 4526 ms 1969 ms 1277 ms

The copy is now performed by default using the JSON format. (The binary format, which is the most performant, is not yet used because it is still a beta feature.)

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@rolnico rolnico requested a review from flo-dup September 5, 2024 14:18
@rolnico rolnico self-assigned this Sep 5, 2024
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@rolnico rolnico changed the title Use binary format in NetworkSerDe.copy Add parameter in NetworkSerDe.copy to choose between formats (xml, binary, etc.) Sep 18, 2024
Copy link

@olperr1 olperr1 merged commit 465eab1 into main Sep 24, 2024
7 checks passed
@olperr1 olperr1 deleted the nro/make_network_copy_use_binaries branch September 24, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants