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

Use expression in tutorial #226

Merged
merged 1 commit into from
May 3, 2022
Merged

Use expression in tutorial #226

merged 1 commit into from
May 3, 2022

Conversation

joaquimg
Copy link
Member

@joaquimg joaquimg commented May 2, 2022

No description provided.

@matbesancon
Copy link
Collaborator

Does this change anything performance-wise?

@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #226 (06003d7) into master (7094aed) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #226   +/-   ##
=======================================
  Coverage   91.21%   91.21%           
=======================================
  Files           8        8           
  Lines         842      842           
=======================================
  Hits          768      768           
  Misses         74       74           

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 7094aed...06003d7. Read the comment docs.

@joaquimg
Copy link
Member Author

joaquimg commented May 2, 2022

this example is too small.
so with no @expresion

julia> @benchmark ᾱ, ∂ᾱ, msē = descent(0.10, 500)
BenchmarkTools.Trial: 13 samples with 1 evaluation.
 Range (min  max):  354.719 ms  513.808 ms  ┊ GC (min  max): 0.00%  1.83%
 Time  (median):     405.427 ms               ┊ GC (median):    1.98%
 Time  (mean ± σ):   409.797 ms ±  48.666 ms  ┊ GC (mean ± σ):  1.25% ± 0.97%

  ██ ██   █        █ ██  █         █      ██                  █
  ██▁██▁▁▁█▁▁▁▁▁▁▁▁█▁██▁▁█▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
  355 ms           Histogram: frequency by time          514 ms <

 Memory estimate: 44.53 MiB, allocs estimate: 490490.

and with @expresion

julia> @benchmark ᾱ, ∂ᾱ, msē = descent(0.10, 500)
BenchmarkTools.Trial: 18 samples with 1 evaluation.
 Range (min  max):  248.046 ms  353.070 ms  ┊ GC (min  max): 0.00%  2.31%
 Time  (median):     291.233 ms               ┊ GC (median):    2.38%
 Time  (mean ± σ):   289.772 ms ±  27.178 ms  ┊ GC (mean ± σ):  1.60% ± 1.29%

  ▃                       ▃█      ▃
  █▁▇▁▁▁▁▁▇▁▇▁▁▁▁▁▁▁▁▁▁▁▇▁██▁▁▇▁▁▇█▁▁▁▁▇▁▁▁▁▁▁▁▇▁▁▁▁▁▁▁▁▁▁▁▁▁▁▇ ▁
  248 ms           Histogram: frequency by time          353 ms <

 Memory estimate: 44.53 MiB, allocs estimate: 490490.

But @expression is the correct JuMP way of doing performant thing, so we want to stimulate users to do it.

@matbesancon matbesancon merged commit 0e9d35a into master May 3, 2022
@matbesancon matbesancon deleted the jg/exp branch May 3, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants