From 7971ccc9c121f377cf1a520942880eddf61105ab Mon Sep 17 00:00:00 2001 From: Dominique Date: Mon, 3 Mar 2025 18:38:03 +0100 Subject: [PATCH] profile_solvers: micro improvement A microscopic code improvement --- src/profiles.jl | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/profiles.jl b/src/profiles.jl index 6901773a..257271f7 100644 --- a/src/profiles.jl +++ b/src/profiles.jl @@ -107,8 +107,8 @@ function profile_solvers( push!(ps, p) end + ipairs = 0 if nsolvers > 2 - ipairs = 0 # combinations of solvers 2 by 2 for i = 2:nsolvers for j = 1:(i - 1) @@ -121,7 +121,7 @@ function profile_solvers( p = performance_profile(b, Ps[1], string.(pair), palette = clrs, legend = :bottomright) ipairs < npairs && xlabel!(p, "") push!(ps, p) - for k = 2:length(Ps) + for k = 2:ncosts p = performance_profile(b, Ps[k], string.(pair), palette = clrs, legend = false) ipairs < npairs && xlabel!(p, "") ylabel!(p, "") @@ -129,14 +129,11 @@ function profile_solvers( end end end - p = plot( - ps..., - layout = (1 + ipairs, ncosts), - size = (ncosts * width, (1 + ipairs) * height); - kwargs..., - ) - else - p = plot(ps..., layout = (1, ncosts), size = (ncosts * width, height); kwargs...) end - p + plot( + ps..., + layout = (1 + ipairs, ncosts), + size = (ncosts * width, (1 + ipairs) * height); + kwargs..., + ) end