ONSAS / ONSAS.jl

An Open Nonlinear Structural Analysis Solver in Julia
MIT License
7 stars 1 forks source link

Faster local dofs #389

Closed mforets closed 1 year ago

mforets commented 1 year ago

This branch is based on https://github.com/ONSAS/ONSAS.jl/pull/388, but is independent.


Before:

julia> @benchmark local_dofs($tetra)
BenchmarkTools.Trial: 10000 samples with 84 evaluations.
 Range (min … max):  813.988 ns … 31.485 μs  ┊ GC (min … max):  0.00% … 96.09%
 Time  (median):     831.345 ns              ┊ GC (median):     0.00%
 Time  (mean ± σ):   938.150 ns ±  1.722 μs  ┊ GC (mean ± σ):  10.43% ±  5.51%

      ▂█▆▄▅                                                     
  ▁▂▄▆██████▆▆▄▄▄▃▃▃▂▃▂▂▂▂▂▂▁▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂
  814 ns          Histogram: frequency by time          943 ns <

 Memory estimate: 1.77 KiB, allocs estimate: 19.

After:

julia> @benchmark local_dofs($tetra)
BenchmarkTools.Trial: 10000 samples with 864 evaluations.
 Range (min … max):  137.731 ns …   3.026 μs  ┊ GC (min … max):  0.00% … 94.03%
 Time  (median):     140.191 ns               ┊ GC (median):     0.00%
 Time  (mean ± σ):   168.730 ns ± 270.235 ns  ┊ GC (mean ± σ):  16.04% ±  9.42%

  █                                                              
  █▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂ ▂
  138 ns           Histogram: frequency by time         2.79 μs <

 Memory estimate: 544 bytes, allocs estimate: 4.
codecov-commenter commented 1 year ago

Codecov Report

Merging #389 (6051295) into main (f6c4a30) will increase coverage by 0.01%. The diff coverage is 88.88%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #389      +/-   ##
==========================================
+ Coverage   86.56%   86.58%   +0.01%     
==========================================
  Files          43       43              
  Lines        1608     1610       +2     
==========================================
+ Hits         1392     1394       +2     
  Misses        216      216              
Impacted Files Coverage Δ
src/Entities/Entities.jl 58.82% <88.88%> (+2.57%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

mvanzulli commented 1 year ago

This need PR needs to be updated 🆗

mforets commented 1 year ago

Interestingly, the error was shown with the newly added test (cantilever). As it turns out, traversal order matters, I left a comment in the modified method.