Hi Christoph, If you pass in a function via an argument the compiler get relatively little information about that function and can not do any optimization on it. That is part of the reason why map(f, xs) is currently slower than a for-loop. There are ongoing discussions on how to solve that problem as an example see https://github.com/JuliaLang/julia/issues/8450
For profiling I used LightTable's ProfileView support and I have to agree with Tim that it is pretty amazing. Valentin On Tuesday, 2 December 2014 07:04:39 UTC+1, Christoph Ortner wrote: > > > > > I took a look at the Lennard-Jones example. On top of the memory >> allocation from array slicing, there is also a lot of overhead in passing >> lj(r) as an input function phi. >> > > this is counterintuitive to me. Why is this a problem? > > Christoph >
