Hi,
I noticed the performance regression in this simple test program of my package PseudoArcLengthContinuation.jl. I have a keyword argument which is only used for printing purposes so it should not affect the computations. Here is a MWE:
using PseudoArcLengthContinuation, LinearAlgebra
println("\n\n--> Continuation method")
k = 2
N = 10
F = (x, p)-> p .* x .+ x.^(k+1)/(k+1) .+ 1.0e-2
Jac_m = (x, p) -> diagm(0 => p .+ x.^k)
opts = PseudoArcLengthContinuation.ContinuationPar(dsmax = 0.02, dsmin=1e-2, ds=0.0001, maxSteps = 140, pMin = -3)
x0 = 0.01 * ones(N)
opts.newtonOptions.tol = 1e-8
opts.newtonOptions.verbose = false
br1, sol, _ = @time PseudoArcLengthContinuation.continuation(F,Jac_m,x0,-1.5,opts,verbosity=0)
br2, sol, _ = @time PseudoArcLengthContinuation.continuation(F,Jac_m,x0,-1.5,opts,verbosity=0, printsolution = x -> norm(x,2))
On my machine, the timings are as follows
0.003155 seconds (21.00 k allocations: 1.335 MiB)
0.348949 seconds (766.59 k allocations: 39.182 MiB, 6.28% gc time)
It looks like a type problem but I enforced the type of keyword parameter printsolution::Function
.
I would appreciate if someone has an idea as I use this type of arguments everywhere…
Thank you for your help,
Best regards