-
Notifications
You must be signed in to change notification settings - Fork 9
Description
@dlfivefifty
The performance of Legendre's plan_transform
sometimes seems to degrade once the number of grid points becomes large. In particular I noticed that:
-
Synthesis
\
is slower than analysis*
. After some profiling @dlfivefifty noticed thatplan_th_leg2cheb!
inFastTransforms
is being called during the run of synthesis. This is likely the cause. -
Sometimes bundling multiple transforms together is not faster than running the transform sequentially in a for loop. Some of this is probably attributed to the call to
plan_th_leg2cheb!
in the synthesis but this behaviour also occurs during analysis. E.g.
F = plan_transform(P, (2000, 1000), 1)
F_1 = plan_transform(P, 2000, 1)
c=rand(2000,1000)
@time c̃ = F * c; # 2.986899 seconds (15 allocations: 15.259 MiB)
d = similar(c);
@time for k in axes(c,2)
d[:,k] = F_1 * c[:,k]
end # 2.758650 seconds (10.93 k allocations: 30.913 MiB)
And the effect is worse in 2D (as the size of the arrays increase)
F = plan_transform(P, (100, 100, 400), (1,2))
F_1 = plan_transform(P, (100,100), (1,2))
c=rand(100,100,400)
@time c̃ = F * c; # 3.856632 seconds (30 allocations: 30.519 MiB)
d = similar(c);
@time for k in axes(c,3)
d[:,:,k] = F_1 * c[:,:,k]
end # 3.332100 seconds (14.00 k allocations: 61.450 MiB, 0.11% gc time)
@MikaelSlevinsky Is the Legendre transform in FastTransforms going to change or is it currently stable?