I have a function `f!`

that operates in-place in a `D`

dimensional Vector, used in DifferentialEquations. For example

```
@inline @inbounds function f!(du, u, p, t)
σ = p[1]; ρ = p[2]; β = p[3]
du[1] = σ*(u[2]-u[1])
du[2] = u[1]*(ρ-u[3]) - u[2]
du[3] = u[1]*u[2] - β*u[3]
return nothing
end
```

However, I am referring to the general case where I have a general `f!`

that operates in-place on a `D`

-element Vector.

Now I want to modify this function, so that it operates on `k`

such vectors “in parallel”. These Vectors are currently the columns of a matrix `S`

, but the storage format does not matter and can be changed.

What I Do is

```
function create_parallel_eom(f!, S)
k = size(S)[2]
veom! = (du, u, p, t) -> begin
for j in 1:k
f!(view(du, :, j), view(u, :, j), p, t)
end
return
end
return veom!
end
```

and then use this `veom!`

to create a new `ODEProblem`

. If I try to do this for 2 parallel vectors, I get a slowdown of 150x instead of the “theoretical” 2x, simply because the vector field function is absurdly expensive compared to calculating it twice without views.

Any tips for making this more performant? At the moment I am looking at `ArrayPartitions`

.