-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
Description
Wrapping something in a gap homomorphism increases allocations considerably.
Is this unavoidable?
julia> L = root_lattice(:E,8);
julia> G,sv = Oscar._isometry_group_via_decomposition(L);
julia> w = similar(sv[1]);
julia> n = length(sv)
240
julia> Sn = symmetric_group(n);
julia> act_func(g) = perm(Sn, Oscar._as_perm(w, matrix(g), sv))
act_func (generic function with 1 method)
julia> fG = hom(G, Sn, act_func)
Group homomorphism
from matrix group of degree 8 over ZZ
to symmetric group of degree 240
julia> g = prod(gens(G));
julia> sort!(sv, lt=Hecke._isless);
julia> @b act_func(g)
60.646 μs (7 allocs: 4.594 KiB)
julia> @b fG(g)
70.468 μs (89 allocs: 8.227 KiB)
So in this case the number of allocations almost doubles.