-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conv is slower than necessary #13996
Comments
You can also use DSP.jl has an implementation of |
function anotherconv{T}(x::Array{T},y::Array{T})
if(length(y)>length(x))
foo = x
x = y
y = foo
end
return filt(y, 1, [x; zeros(length(y)-1)])
end |
FYI: recent work at MIT Accelerated Convolutions for Efficient Multi-Scale Time to Contact Computation in Julia Maybe you already know about this and have it wrapped in, but I can't find it and then this pointer might be useful to others also. |
Thanks for the mention. Both packages have been updated. |
Moved to JuliaDSP/DSP.jl#167 |
It seems that
conv
is slower than necessary. By implementing a naive convolution, I am able to outperformconv
for moderate vector sizes. On my particular machine, naive convolution is better thanconv
if the product of vector sizes is less than 100 000.Just so everyone sees what the naive solution is, I'm pasting it below.
Here is a performance plot:
Edit: tweaked code for better heuristic as to when slowconv is faster than fastconv.
The text was updated successfully, but these errors were encountered: