Skip to content

More performance #201

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed

More performance #201

wants to merge 1 commit into from

Conversation

YingboMa
Copy link
Contributor

@YingboMa YingboMa commented Apr 5, 2022

No description provided.

This was referenced Apr 8, 2022
```julia
julia> using SIMDPolynomials, BenchmarkTools

julia> x, y, z, t = [PackedMonomial{4,7}(i) for i in 0:3]; # PackedMonomial with maximum of 4 variables and 7 bits of exponents.

julia> p = x * y + 3 * (z * t)
x₀x₁ + 3x₂x₃

julia> q = (p + 1) * p
x₀²x₁² + 6x₀x₁x₂x₃ + 9x₂²x₃² + x₀x₁ + 3x₂x₃

julia> @Btime gcd($p, $q)
  11.260 μs (354 allocations: 18.77 KiB)
x₀x₁ + 3x₂x₃

julia> begin
           c1 = 10*(x * z + x)
           c2 = 2*(x^2 + z)
           c3 = 2*(2 - z  )
           c4 = 20*(x * z^2)
           e1 = 0
           e2 = 5
           e3 = 7
           e4 = 10
           p = c1 * y^e1 + c2 * y^e2 + c3 * y^e3 + c4 * y^e4
           q = prod(i->p + i, 0:3)
       end;

julia> @Btime for i in 0:3
           gcd($p + i, $q)
       end
  1.330 ms (35340 allocations: 2.12 MiB)
```
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant