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

Compile version-specific functions #57

Merged
merged 1 commit into from
Nov 14, 2021
Merged

Compile version-specific functions #57

merged 1 commit into from
Nov 14, 2021

Conversation

nickrobinson251
Copy link
Owner

@nickrobinson251 nickrobinson251 commented Nov 14, 2021

Speed up first call by splitting the top-level parse_network into version-specific function sooner.

(xref #52)

Some quick benchmarks below


v33 file on this branch:

julia> @time parse_network("../PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
  0.957465 seconds (640.32 k allocations: 135.810 MiB, 3.77% gc time, 70.28% compilation time)

julia> @time parse_network("../PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
  0.284085 seconds (1.16 k allocations: 96.066 MiB, 8.94% gc time)

on main:

julia> @time parse_network("../PowerSystemsTestData/ACTIVSg70k/ACTIVSg70k.RAW");
  1.548256 seconds (1.14 M allocations: 164.239 MiB, 3.83% gc time, 80.19% compilation time)

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

v30 file on this branch:

julia> @time parse_network("raw/realistic30.raw");
  0.863707 seconds (592.45 k allocations: 103.168 MiB, 3.84% gc time, 73.19% compilation time)

julia> @time parse_network("raw/realistic30.raw");
  0.176325 seconds (1.24 k allocations: 66.259 MiB, 8.40% gc time)

on main:

julia> @time parse_network("raw/realistic30.raw");
  1.336480 seconds (1.06 M allocations: 129.593 MiB, 1.94% gc time, 85.16% compilation time)

julia> @time parse_network("raw/realistic30.raw");
  0.200634 seconds (1.27 k allocations: 66.265 MiB, 9.33% gc time)

this branch:

julia> @time parse_network("raw/realistic29.raw");
  0.880513 seconds (591.73 k allocations: 111.991 MiB, 3.25% gc time, 75.70% compilation time)

julia> @time parse_network("raw/realistic29.raw");
  0.217870 seconds (1.24 k allocations: 75.134 MiB, 5.17% gc time)

on main:

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

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

@codecov-commenter
Copy link

Codecov Report

Merging #57 (02c660d) into main (3ecca18) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   94.56%   94.51%   -0.05%     
==========================================
  Files           3        3              
  Lines         331      328       -3     
==========================================
- Hits          313      310       -3     
  Misses         18       18              
Impacted Files Coverage Δ
src/parsing.jl 98.59% <100.00%> (-0.02%) ⬇️

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 3ecca18...02c660d. Read the comment docs.

@nickrobinson251 nickrobinson251 merged commit 2357f80 into main Nov 14, 2021
@nickrobinson251 nickrobinson251 deleted the npr/firstcall branch November 14, 2021 22:54
@nickrobinson251
Copy link
Owner Author

nickrobinson251 commented Nov 14, 2021

Numbers from before #47(of course, no numbers for the v33 file) :

julia> @time parse_network("raw/realistic30.raw");
 0.566602 seconds (331.92 k allocations: 82.066 MiB, 13.27% gc time, 56.64% compilation time)

julia> @time parse_network("raw/realistic30.raw");
 0.192522 seconds (1.13 k allocations: 60.640 MiB, 2.68% gc time)
julia> @time parse_network("raw/realistic29.raw");
 0.518445 seconds (331.92 k allocations: 90.753 MiB, 2.80% gc time, 64.44% compilation time)

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

So this PR gets us a lot closer to those numbers, but not all the way back.

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.

None yet

2 participants