Closed Datseris closed 1 year ago
No it doesn't since probably findall is more optimized than a simple loop (I see a 2x slowdown with iteration).
However changing trees = zeros(Int, griddims),)
in trees = zeros(Int8, griddims),)
helps a bit (15% faster, not much) in terms of performance
Actually somewhat better than expected, forestfire-large in respect to Mesa passed from 494x to 645x
This line does not appear optimal to me:
https://github.com/JuliaDynamics/ABM_Framework_Comparisons/blob/main/ForestFire/Agents/ForestFire.jl#L17
findall(isequal(2), forest.trees)
allocates a vector with the burning trees. To do that, it anyways iterates over all trees.Wouldn't it faster to explicitly iterate ourselves and skip non burning trees? I.e., do