Hello!
I have a bit of a complex code, where I use TimerOutputs to track progress. I have the following code bit:
In Line 343 I am updating the position variable. Position, Velocity, Acceleration are SVectors inside of Vectors and the other variables are floating point values. TimerOutputs gives the following:
If I comment line 343 out:
Next I try to check if allocations occur using @allocated
as such:
![image](https://global.discourse-cdn.com/julialang/original/3X/8/d/8d4bd5039221362ca19cf73d1947689f199dbfc0.png)
No print statements appear in terminal, i.e. @allocated
returns zero, but the SimulationLoop still returns average of 985 bytes.
I am a bit perplexed how this can happen, and I wonder if anyone has experienced something similar?
I have done a small check and noted that:
![image](https://global.discourse-cdn.com/julialang/original/3X/5/e/5e389b1d2839fec3f67508d21611d2167969aadf.png)
Where it is seen that adding SVector(0,0)
to Position does not allocate, but adding 1,1 does.
I don’t really have a MWE sorry, since this is quite nested code in a branch of a repo I am working on, but sharing here since some can probably provide me some guidance on whether what I am seeing is actual or if it is a bug in TimerOutputs.
Kind regards