-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
rework precompilation using SnoopPrecompile
#4334
Conversation
5db861f
to
7bb7802
Compare
@t-bltg : Please let me know when it's finished. I will then merge the GR development branch in the master branch and tag a new version ASAP. |
I've reworked it, and this should be ready for review / comments. |
SnoopPrecompile
Did you test locally if this precompiles with the GR branch? I would also be interested to see the differences in loading times/ TTFP. |
jheinen/GR.jl#465 is needed for this PR to work, so we are awaiting a new GR version from @jheinen.
Scenario, with main() = begin
for i in (1, 5, 10, 11, 13, 14, 15, 16, 19, 20, 23, 24, 27, 28, 35, 38, 53, 54, 56, 57, 58, 60)
script = """
using Plots
ex(i) = begin
pl = Plots.test_examples(:gr, i, disp=false)
Plots.png(pl, "gr-" * string(i))
Plots.pdf(pl, "gr-" * string(i))
end
@time ex(parse(Int, first(ARGS)))
"""
run(`$(Base.julia_cmd()) -e $script $i`)
end
end
main() [ Info: Testing plot: gr:1:Lines
10.276396 seconds (10.68 M allocations: 554.345 MiB, 4.33% gc time, 99.41% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:5:Global
13.367969 seconds (16.11 M allocations: 831.746 MiB, 4.16% gc time, 99.36% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:10:Histogram2D
12.630873 seconds (14.24 M allocations: 744.904 MiB, 4.18% gc time, 99.49% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:11:Line types
11.810301 seconds (14.16 M allocations: 736.157 MiB, 4.27% gc time, 99.15% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:13:Marker types
10.646469 seconds (11.89 M allocations: 617.070 MiB, 4.00% gc time, 98.97% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:14:Bar
11.272947 seconds (13.10 M allocations: 679.028 MiB, 4.43% gc time, 99.45% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:15:Histogram
11.688254 seconds (12.62 M allocations: 656.876 MiB, 3.99% gc time, 99.49% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:16:Subplots
10.518674 seconds (12.41 M allocations: 649.709 MiB, 4.16% gc time, 99.29% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:19:Open/High/Low/Close
10.089114 seconds (10.40 M allocations: 540.604 MiB, 3.94% gc time, 99.48% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:20:Annotations
11.637137 seconds (13.55 M allocations: 705.220 MiB, 4.11% gc time, 99.33% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:23:Pie
10.939707 seconds (13.37 M allocations: 695.601 MiB, 4.35% gc time, 99.33% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:24:3D
12.762531 seconds (15.16 M allocations: 790.374 MiB, 4.12% gc time, 99.30% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:27:Polar Plots
10.341857 seconds (10.80 M allocations: 560.419 MiB, 3.84% gc time, 99.28% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:28:Heatmap, categorical axes, and aspect_ratio
11.085066 seconds (14.73 M allocations: 750.466 MiB, 5.07% gc time, 99.41% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:35:Lines and markers with varying colors
11.759844 seconds (13.21 M allocations: 684.206 MiB, 3.93% gc time, 99.23% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:38:Histogram2D (complex values)
12.849030 seconds (14.66 M allocations: 766.957 MiB, 4.09% gc time, 99.45% compilation time: 5% of which was recompilation)
[ Info: Testing plot: gr:53:Step Types
10.968680 seconds (12.48 M allocations: 649.566 MiB, 3.99% gc time, 99.22% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:54:Guide positions and alignment
11.958675 seconds (14.41 M allocations: 746.445 MiB, 4.10% gc time, 99.12% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:56:Bar plot customizations
14.026715 seconds (16.85 M allocations: 878.849 MiB, 3.71% gc time, 99.35% compilation time: 3% of which was recompilation)
[ Info: Testing plot: gr:57:Vertical and horizonal spans
10.837500 seconds (12.35 M allocations: 642.858 MiB, 4.36% gc time, 99.41% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:58:Stacked area chart
11.005754 seconds (13.02 M allocations: 677.565 MiB, 4.37% gc time, 99.38% compilation time: 4% of which was recompilation)
[ Info: Testing plot: gr:60:3D projection
11.738911 seconds (14.53 M allocations: 759.607 MiB, 4.54% gc time, 99.11% compilation time: 4% of which was recompilation) Plots@PR [ Info: Testing plot: gr:1:Lines
7.817280 seconds (765.89 k allocations: 38.379 MiB, 2.45% gc time, 96.77% compilation time: 19% of which was recompilation)
[ Info: Testing plot: gr:5:Global
10.675643 seconds (5.27 M allocations: 273.975 MiB, 2.98% gc time, 99.25% compilation time: 16% of which was recompilation)
[ Info: Testing plot: gr:10:Histogram2D
10.268749 seconds (4.96 M allocations: 259.561 MiB, 3.43% gc time, 99.36% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:11:Line types
9.338404 seconds (1.77 M allocations: 92.299 MiB, 1.91% gc time, 99.14% compilation time: 16% of which was recompilation)
[ Info: Testing plot: gr:13:Marker types
8.407991 seconds (1.52 M allocations: 77.188 MiB, 98.57% compilation time: 18% of which was recompilation)
[ Info: Testing plot: gr:14:Bar
8.883329 seconds (2.25 M allocations: 116.019 MiB, 99.18% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:15:Histogram
9.327184 seconds (2.06 M allocations: 106.498 MiB, 99.27% compilation time: 16% of which was recompilation)
[ Info: Testing plot: gr:16:Subplots
8.792240 seconds (2.63 M allocations: 137.007 MiB, 3.07% gc time, 99.06% compilation time: 6% of which was recompilation)
[ Info: Testing plot: gr:19:Open/High/Low/Close
8.084275 seconds (783.65 k allocations: 39.444 MiB, 2.41% gc time, 96.84% compilation time: 19% of which was recompilation)
[ Info: Testing plot: gr:20:Annotations
9.189509 seconds (1.65 M allocations: 85.196 MiB, 2.84% gc time, 99.12% compilation time: 16% of which was recompilation)
[ Info: Testing plot: gr:23:Pie
8.664856 seconds (2.02 M allocations: 104.369 MiB, 3.08% gc time, 96.75% compilation time: 18% of which was recompilation)
[ Info: Testing plot: gr:24:3D
10.682581 seconds (6.28 M allocations: 332.592 MiB, 2.98% gc time, 99.19% compilation time: 14% of which was recompilation)
[ Info: Testing plot: gr:27:Polar Plots
8.879845 seconds (2.61 M allocations: 133.232 MiB, 3.07% gc time, 99.09% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:28:Heatmap, categorical axes, and aspect_ratio
9.261369 seconds (4.95 M allocations: 258.421 MiB, 3.10% gc time, 99.27% compilation time: 6% of which was recompilation)
[ Info: Testing plot: gr:35:Lines and markers with varying colors
9.784166 seconds (2.67 M allocations: 137.627 MiB, 2.42% gc time, 98.98% compilation time: 15% of which was recompilation)
[ Info: Testing plot: gr:38:Histogram2D (complex values)
11.133116 seconds (5.01 M allocations: 262.668 MiB, 2.57% gc time, 99.28% compilation time: 14% of which was recompilation)
[ Info: Testing plot: gr:53:Step Types
9.069108 seconds (1.62 M allocations: 83.649 MiB, 2.96% gc time, 99.00% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:54:Guide positions and alignment
9.831715 seconds (2.39 M allocations: 124.463 MiB, 2.55% gc time, 98.62% compilation time: 15% of which was recompilation)
[ Info: Testing plot: gr:56:Bar plot customizations
11.356569 seconds (5.69 M allocations: 297.598 MiB, 2.60% gc time, 99.25% compilation time: 12% of which was recompilation)
[ Info: Testing plot: gr:57:Vertical and horizonal spans
8.583749 seconds (2.17 M allocations: 113.321 MiB, 99.16% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:58:Stacked area chart
8.759219 seconds (2.12 M allocations: 110.625 MiB, 99.21% compilation time: 17% of which was recompilation)
[ Info: Testing plot: gr:60:3D projection
9.168367 seconds (3.69 M allocations: 197.162 MiB, 2.79% gc time, 98.88% compilation time: 16% of which was recompilation) So this PR is actually better for TTFP ↘25% (mostly through reducing allocations significantly - more than 60% and up to 80%). |
Okay we need to reflect this in the compat section of the |
Done in ae44c0c, and awaiting
Where ? |
On master. Worst case we need to revert #4346 |
Mmmh I don't any hang in ci on any OS - especially macOS (https://github.com/JuliaPlots/Plots.jl/actions/runs/3081000582/jobs/4979033686). But the docs are broken because of |
Thats good! Might have been fluke then. |
Codecov ReportBase: 80.81% // Head: 80.53% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4334 +/- ##
==========================================
- Coverage 80.81% 80.53% -0.28%
==========================================
Files 28 28
Lines 7317 7336 +19
==========================================
- Hits 5913 5908 -5
- Misses 1404 1428 +24
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
We're still fixing some bugs in the GR run-time - will tag the [email protected] version (hopefully) tomorrow along with a |
[email protected] is on the way! The new tag should appear in the next few minutes ... |
@t-bltg : I made a change in GR#master (see this commit) to allow conditionally importing the For us, using a local GR run-time is (still) essential. |
@jheinen, this change will break the new precompilation sequence introduced in this PR and now in master (not yet released). ERROR: LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this.
I don't understand: what is preventing changing the artifacts using a local installation using |
Because it's not sufficient only to change |
@jheinen, let's continue the discussion in jheinen/GR.jl#471. |
Fix #4079.
SnoopPrecompile
to generate precompilation statements fromPlots
examples;SnoopCompile
workflow (broken on1.8
+), and the (noisy) precompilation related auto PRs;0.68
.Blocking issue with
SnoopPrecompile
andGR
: timholy/SnoopCompile.jl#295.GR fix: jheinen/GR.jl#465.