JuliaIBPM / ViscousFlow.jl

A framework for simulating viscous incompressible flows about arbitrary body shapes.
https://JuliaIBPM.github.io/ViscousFlow.jl/latest
Other
100 stars 28 forks source link

WIP: Reduce memory allocations #1

Closed darwindarak closed 7 years ago

darwindarak commented 7 years ago

Benchmark on a single call to TimeMarching.ifherk!

Before

BenchmarkTools.Trial:
  memory estimate:  97.73 MiB
  allocs estimate:  2899
  --------------
  minimum time:     43.258 ms (4.76% GC)
  median time:      43.883 ms (4.82% GC)
  mean time:        46.662 ms (10.80% GC)
  maximum time:     95.698 ms (54.67% GC)
  --------------
  samples:          108
  evals/sample:     1

After

BenchmarkTools.Trial:
  memory estimate:  28.72 MiB
  allocs estimate:  2237
  --------------
  minimum time:     37.614 ms (1.26% GC)
  median time:      37.765 ms (1.35% GC)
  mean time:        37.976 ms (1.70% GC)
  maximum time:     40.794 ms (1.26% GC)
  --------------
  samples:          132
  evals/sample:     1
jdeldre commented 7 years ago

Looks great! Let's merge these into the main branch.

darwindarak commented 7 years ago

Sounds good. I don't have merge access though, can you do it?

jdeldre commented 7 years ago

I merged it. Seems like there is probably a bug, though. I looked briefly but haven't found it yet.

darwindarak commented 7 years ago

Which example is the bug appearing in?

jdeldre commented 7 years ago

In the Navier-Stokes with body: the vorticity field is corrupted. (It doesn't appear in the Navier-Stokes without body...)

jdeldre commented 7 years ago

Never mind! It's fine!