Memory usage data for getproperty function

Do not implement Base.getproperty in this way, use simple if-else instead:

if v === :lattice
  return getfield(system.cell, v)
elseif v === :k_lattice
   return getfield(system.cell, v)
...

I think getproperty function should not need to allocate memories, so are these numbers only times the
corresponding lines are executed?

Several arrays are created in your code, so the function allocates.

1 Like