From de600de0a225793e2d841f0626221f6ac4d08359 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Sat, 2 Apr 2022 15:53:55 +0200 Subject: [PATCH] better reporting of timings in tests --- test/AutSigma_41.jl | 13 ++++++++++--- test/benchmarks.jl | 3 +-- test/free_groups.jl | 3 ++- test/runtests.jl | 34 ++++++++++++++++++++++------------ 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/test/AutSigma_41.jl b/test/AutSigma_41.jl index 7a9e0d1..49e0135 100644 --- a/test/AutSigma_41.jl +++ b/test/AutSigma_41.jl @@ -121,15 +121,22 @@ using Groups.KnuthBendix u = (a6 * a5)^-1 * b1 * (a6 * a5) x = (a6 * a5 * a4 * a3 * a2 * u * a1^-1 * a2^-1 * a3^-1 * a4^-1) # yet another auxillary # x = (a4^-1*a3^-1*a2^-1*a1^-1*u*a2*a3*a4*a5*a6) - @time evaluate(x) + b3 = x * a0 * x^-1 - b3im = @time evaluate(b3) - b3cim = @time let g = b3 + b3im = evaluate(b3) + b3cim = let g = b3 f = Groups.compiled(g) f(Groups.domain(g)) end @test b3im == b3cim @test a0 * b2 * b1 == a1 * a3 * a5 * b3 + + @time evaluate(x) + let g = b3 + f = Groups.compiled(g) + f(Groups.domain(g)) + @time f(Groups.domain(g)) + end end end diff --git a/test/benchmarks.jl b/test/benchmarks.jl index 4a6db1f..44db248 100644 --- a/test/benchmarks.jl +++ b/test/benchmarks.jl @@ -2,7 +2,6 @@ using BenchmarkTools using Test using Groups -using Groups.New function wl_ball(F; radius::Integer) g, state = iterate(F) @@ -47,7 +46,7 @@ end @testset "iteration: SAut(F_n)" begin R = 4 FN = FreeGroup(N) - SAutFN = New.SpecialAutomorphismGroup(FN) + SAutFN = SpecialAutomorphismGroup(FN) let G = SAutFN S = unique([gens(G); inv.(gens(G))]) diff --git a/test/free_groups.jl b/test/free_groups.jl index ced86a8..f35d85e 100644 --- a/test/free_groups.jl +++ b/test/free_groups.jl @@ -37,6 +37,8 @@ @test k == a*b^-1 @time k = test_iteration(F3, 1000) + + @time test_iteration(F3, 1000) @test k == (a^2)*c^2*a^-1 end @@ -67,5 +69,4 @@ test_Group_interface(F3) test_GroupElement_interface(rand(F3, 2)...) end - end diff --git a/test/runtests.jl b/test/runtests.jl index fabfb6e..061fac8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -11,20 +11,30 @@ include(joinpath(pathof(GroupsCore), "..", "..", "test", "conformance_test.jl")) @testset "Groups" begin - include("free_groups.jl") - include("fp_groups.jl") + _, t = @timed include("free_groups.jl") + @info "free_groups.jl took $(round(t, digits=2))s" + _, t = @timed include("fp_groups.jl") + @info "fp_groups.jl took $(round(t, digits=2))s" - include("matrix_groups.jl") - include("AutFn.jl") + _, t = @timed include("matrix_groups.jl") + @info "matrix_groups.jl took $(round(t, digits=2))s" + _, t = @timed include("AutFn.jl") + @info "AutFn.jl took $(round(t, digits=2))s" - include("homomorphisms.jl") + _, t = @timed include("homomorphisms.jl") + @info "homomorphisms.jl took $(round(t, digits=2))s" - include("AutSigma_41.jl") - include("AutSigma3.jl") + if haskey(ENV, "CI") + _, t = @timed include("AutSigma_41.jl") + @info "AutSigma_41 took $(round(t, digits=2))s" + _, t = @timed include("AutSigma3.jl") + @info "AutSigma3 took $(round(t, digits=2))s" + end - include("group_constructions.jl") - - # if !haskey(ENV, "CI") - # include("benchmarks.jl") - # end + _, t = @timed include("group_constructions.jl") + @info "Constructions took $(round(t, digits=2))s" +end + +if !haskey(ENV, "CI") + include("benchmarks.jl") end