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

Support parsing of v33 data #47

Merged
merged 28 commits into from
Nov 14, 2021
Merged

Support parsing of v33 data #47

merged 28 commits into from
Nov 14, 2021

Conversation

nickrobinson251
Copy link
Owner

@nickrobinson251 nickrobinson251 commented Oct 27, 2021

@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2021

Codecov Report

Merging #47 (08cd885) into main (ce4e3a9) will increase coverage by 0.29%.
The diff coverage is 98.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   94.26%   94.56%   +0.29%     
==========================================
  Files           3        3              
  Lines         279      331      +52     
==========================================
+ Hits          263      313      +50     
- Misses         16       18       +2     
Impacted Files Coverage Δ
src/types.jl 95.19% <97.14%> (-0.32%) ⬇️
src/parsing.jl 98.61% <98.82%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce4e3a9...08cd885. Read the comment docs.

@nickrobinson251
Copy link
Owner Author

This now parses a v33 file

However the changes on this branch reduce performance of the code on non-v33 files:

On this branch:

julia> using PowerFlowData

julia> @time parse_network("raw/realistic29.raw");
  1.348236 seconds (1.06 M allocations: 138.400 MiB, 2.10% gc time, 82.74% compilation time)

julia> @time parse_network("raw/realistic29.raw");
  0.219198 seconds (1.27 k allocations: 75.141 MiB, 10.57% gc time)

On main

julia> using PowerFlowData

julia> @time parse_network("raw/realistic29.raw");
  0.601938 seconds (331.93 k allocations: 90.757 MiB, 5.39% gc time, 63.28% compilation time)

julia> @time parse_network("raw/realistic29.raw");
  0.196851 seconds (1.13 k allocations: 69.327 MiB, 4.45% gc time)

i'm inclined to leave this to future work as this is already a huge PR and likely still needs some other cleanup (as well as tests)

@nickrobinson251
Copy link
Owner Author

nickrobinson251 commented Nov 14, 2021

Some timings, using a v33 file in https://github.com/NREL-SIIP/PowerSystemsTestData/
Running each one twice, so we can see with and without the compilation time of the first run.

PowerModels.jl (v0.18.3)

(with logging disabled via Memento.setlevel!(Memento.getlogger(PowerModels), "error"))

julia> @time PowerModels.parse_psse("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
 97.266027 seconds (695.57 M allocations: 15.219 GiB, 5.58% gc time, 2.52% compilation time)

julia> @time PowerModels.parse_psse("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
 97.628370 seconds (692.60 M allocations: 15.049 GiB, 6.54% gc time)

PowerSystems.jl (v1.15.1)

(with logging disabled via Logging.disable_logging(Logging.Error))

julia> @time PowerSystems.parse_psse("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
 86.812174 seconds (684.53 M allocations: 14.675 GiB, 6.07% gc time, 0.56% compilation time)

julia> @time PowerSystems.parse_psse("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
 96.440231 seconds (681.18 M allocations: 14.480 GiB, 6.52% gc time)

PowerFlowData.jl (this branch)

julia> @time parse_network("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
  1.584180 seconds (1.10 M allocations: 162.025 MiB, 82.08% compilation time)

julia> @time parse_network("PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
  0.248645 seconds (1.19 k allocations: 96.073 MiB)

So right now we're >10x faster on first run, and >100x on subsequent runs. We also have >100x fewer allocations on first run, and 10,000x on subsequent runs. And overall allocate ~100x less memory.

@nickrobinson251 nickrobinson251 changed the title Initial exploration of supporting v33 data Support parsing of v33 data Nov 14, 2021
@quinnj
Copy link
Contributor

quinnj commented Nov 14, 2021

Dang those are some sweet performance improvements!

@nickrobinson251 nickrobinson251 marked this pull request as ready for review November 14, 2021 12:57
@nickrobinson251 nickrobinson251 merged commit 5841551 into main Nov 14, 2021
@nickrobinson251 nickrobinson251 deleted the npr/v33 branch November 14, 2021 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants