Closed frankschae closed 1 year ago
Perhaps surprisingly, NoiseGrid is pretty slow when a long time series is used.
NoiseGrid
dt = 0.001 W = WienerProcess!(0.0, rand(2)) prob = NoiseProblem(W, (0.0, 1000.0)) sol = @btime solve(prob; dt=dt) # 92.881 ms NG = NoiseGrid(sol.t, sol.u) _prob = NoiseProblem(NG, (0.0, 1000.0)) _sol = @btime solve(_prob; dt=dt) # 677.373 ms @test _sol.u ≈ sol.u
Would it be worth introducing a ref pointer to "guess" the next grid point? This avoids the need to search the entire time grid for each interpolation step: https://github.com/SciML/DiffEqNoiseProcess.jl/blob/master/src/noise_interfaces/noise_grid_interface.jl#L27-L31 and instead only do a full search if it's not the point one to the right/left of the previous point.
Agreed, interpolations like that are generally slow because of the search.
Perhaps surprisingly,
NoiseGrid
is pretty slow when a long time series is used.Would it be worth introducing a ref pointer to "guess" the next grid point? This avoids the need to search the entire time grid for each interpolation step: https://github.com/SciML/DiffEqNoiseProcess.jl/blob/master/src/noise_interfaces/noise_grid_interface.jl#L27-L31 and instead only do a full search if it's not the point one to the right/left of the previous point.