JuliaDiff / SparseDiffTools.jl

Fast jacobian computation through sparsity exploitation and matrix coloring
MIT License
237 stars 41 forks source link

Fix allocation in auto_jacvec! #176

Closed YingboMa closed 2 years ago

YingboMa commented 2 years ago

Before:

julia> @btime auto_jacvec!($dy, $f, $x, $v, $cache1, $cache2);
  99.454 μs (1200 allocations: 32.81 KiB)

After:

julia> @btime auto_jacvec!($dy, $f, $x, $v, $cache1, $cache2);
  44.668 μs (0 allocations: 0 bytes)

Pointed out by @chriselrod

codecov-commenter commented 2 years ago

Codecov Report

Merging #176 (b61db54) into master (66a0303) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #176   +/-   ##
=======================================
  Coverage   78.73%   78.73%           
=======================================
  Files          14       14           
  Lines         757      757           
=======================================
  Hits          596      596           
  Misses        161      161           
Impacted Files Coverage Δ
src/differentiation/jaches_products.jl 96.62% <100.00%> (ø)

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 66a0303...b61db54. Read the comment docs.