Nemocas / Nemo.jl

Julia bindings for various mathematical libraries (including flint2)
http://nemocas.github.io/Nemo.jl/
Other
176 stars 57 forks source link

Use `fmpq_mul_si` #1776

Closed joschmitt closed 1 month ago

joschmitt commented 1 month ago

I noticed that *(::QQFieldElem, ::Int) calls generic AbstractAlgebra code instead of flint.

Before

julia> a = QQ(1, 2)
1//2

julia> @btime 2*a;
  116.807 ns (11 allocations: 192 bytes)

After

julia> @btime 2*a;
  20.632 ns (1 allocation: 32 bytes)

This is related to https://github.com/thofma/Hecke.jl/issues/1537 .