homalg-project / MatricesForHomalg.jl

Matrices for the homalg project
GNU Lesser General Public License v3.0
0 stars 3 forks source link

Matrix multiplication is incredibly slow #48

Open zickgraf opened 3 months ago

zickgraf commented 3 months ago
julia> using MatricesForHomalg

julia> Q = HomalgFieldOfRationals();

julia> M = HomalgIdentityMatrix(200, Q);

julia> @time M * M;
 14.694862 seconds (224.14 M allocations: 4.652 GiB, 32.85% gc time)
zickgraf commented 3 months ago

Over the integers, things are a bit better but still very slow:

julia> Z = HomalgRingOfIntegers();

julia> M = HomalgIdentityMatrix(200, Z);

julia> @time M * M;
  1.984669 seconds (32.10 M allocations: 614.044 MiB, 33.34% gc time, 2.17% compilation time)

In native GAP, the multiplication takes only about a millisecond:

gap> M := IdentityMat( 200 );;
gap> CallFuncListWithTime(\*, [ M, M ]);;
0.0009120000000000001 Secs.
mohamed-barakat commented 3 months ago

This is amazing.