Computing linear convolution efficiently

Interesting. I’m surprised that Toeplitz could save any memory. Looking at DSP.conv, it’s hard to see where there might be unnecessary allocations that could be removed. Are you sure you don’t have unnecessary allocations in your functions directconv? There might be subtle allocations between your implementations. Perhaps you can share your test.

By the way, there may be a way to save memory at the end, using views. Rather than allocating to store the truncated output, you might get away with hfull = conv(f, g) and then h = @view hfull[from:to], which is in-place and should act as if the array had been truncated.