Investigate long compile times

Hi,

Can someone help me have an idea why the following call takes ~2mn to compile please? If you have an idea of the culprit and suggestions, I’d be very happy to hear them :smiley:

Thanks a lot for your help,

fold_po_coll = @time continuation(deepcopy(br_po), 1, (@optic _.c5), opts_pocoll_fold;
        detect_codim2_bifurcation = 0,
        jacobian_ma = :minaug,
        bdlinsolver = BorderingBLS(solver = DefaultLS(), check_precision = false),
        )

The function calls continuation_coll_fold and then the general continuation_fold. In comparison, calling the function continuation_coll_pd does not lead to large compiles times (~10s).

I know that I have closures in continuation_fold but this is true for continuation_pd and this does not seem to cause large compile times.

Below is a MWE to show the compile time:

using Revise
using BifurcationKit

function Fsl(u, p)
    (;r, μ, ν, c3, c5) = p
    u1, u2 = u
    f = similar(u)
    ua = u1^2 + u2^2
    f[1] = r * u1 - ν * u2 + ua * (c3 * u1 - μ * u2) + c5 * ua^2 * u1
    f[2] = r * u2 + ν * u1 + ua * (c3 * u2 + μ * u1) + c5 * ua^2 * u2
    return f
end

par_sl = (r = -0.5, μ = 0., ν = 1.0, c3 = 0.1, c5 = -0.01)
prob = BifurcationProblem(Fsl, [0., 0], par_sl, (@optic _.r))

opts = ContinuationPar(p_min = -1.)
br = continuation(prob, PALC(), opts)

# branch of periodic orbits
br_po = continuation(br, 1, opts,
        PeriodicOrbitOCollProblem(20, 4)
        )

# computation of folds of periodic orbits
opts_pocoll_fold = ContinuationPar(br_po.contparams, max_steps = 10, p_max=1.2)
fold_po_coll = @time continuation(deepcopy(br_po), 1, (@optic _.c5), opts_pocoll_fold;
        detect_codim2_bifurcation = 0,
        jacobian_ma = :minaug,
        bdlinsolver = BorderingBLS(solver = DefaultLS(), check_precision = false),
        )