Skip to content

Conversation

odow
Copy link
Member

@odow odow commented Feb 10, 2025

Follow up to #2620 that brings things down to

julia> @benchmark(
           MOI.Nonlinear.ReverseAD._reverse_mode($(evaluator.backend), x),
           setup=(x=rand(num_variables(model))),
       )
BenchmarkTools.Trial: 50 samples with 1 evaluation per sample.
 Range (min  max):   97.891 ms  117.640 ms  ┊ GC (min  max): 0.00%  0.00%
 Time  (median):      98.921 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   100.545 ms ±   3.878 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

  █ ▁▂                                                           
  ████▆▁▄▃▃▃▁▁▁▃▄▁▄▁▁▃▃▁▁▁▁▁▃▃▁▁▁▃▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃ ▁
  97.9 ms          Histogram: frequency by time          118 ms <

 Memory estimate: 0 bytes, allocs estimate: 0.

I can't find the reason I made these mutable. See the latest commit. I guess I wanted to make minimal changes to the existing code.

They didn't exist in the original JuMP code:
https://github.com/jump-dev/JuMP.jl/blob/0a6b1e426425e69234f073079c3ebe6301a43f25/src/_Derivatives/forward.jl#L30-L31
so when I created them in #1803 I guess I had a reason for making them mutable at some point that didn't survive the final factoring.

@odow odow merged commit 6468097 into master Feb 10, 2025
16 checks passed
@odow odow deleted the od/mutable branch February 10, 2025 18:59
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