Dear All, I'm having some issues with code speed for some Gillespie type simulations. The toy model is described here:
http://phylodynamics.blogspot.co.uk/2013/06/comparing-performance-of-r-and-rcpp-for.html http://phylodynamics.blogspot.co.uk/2013/06/an-sir-model-in-julia.html I get good performance with my vanilla Julia code, but a more generic implementation is slower: http://github.com/sdwfrost/Gillespie.jl The gist is here: https://gist.github.com/sdwfrost/1b4bce19faf2d7b8624cac048a36f32d Lines 57 and 70 appear to be the culprit: https://github.com/sdwfrost/Gillespie.jl/blob/master/src/SSA.jl I've tried some devectorisation, but in my hackery, I appear to get side effects, where the argument x0 passed to the ssa function is modified. Any tips? Best Simon