Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Compilation time of generating a quadrature rule is very long #128

Closed
fredrikekre opened this issue Mar 30, 2017 · 4 comments
Closed

Compilation time of generating a quadrature rule is very long #128

fredrikekre opened this issue Mar 30, 2017 · 4 comments

Comments

@fredrikekre
Copy link
Member

Probably due to @nloops and friends? Mostly on v0.6, but pretty slow on v0.5 aswell:

v0.5:

julia> using JuAFEM

julia> @time qr = QuadratureRule{2, RefCube}(:legendre, 2);
  3.661755 seconds (5.95 M allocations: 239.781 MB, 2.25% gc time)

v0.6:

julia> using JuAFEM

julia> @time qr = QuadratureRule{2, RefCube}(:legendre, 2);
 10.056088 seconds (11.82 M allocations: 544.792 MiB, 1.60% gc time)
@fredrikekre
Copy link
Member Author

function _points_weights(quad_type::Symbol, order::Int)
    if quad_type == :legendre
        p, w = gausslegendre(order)
    elseif quad_type == :lobatto
        p, w = gausslobatto(order)
    else
        throw(ArgumentError("unsupported quadrature rule"))
    end
    return p, w
end

gives:

julia> @time JuAFEM._points_weights(:legendre, 2);
  8.583793 seconds (11.41 M allocations: 529.193 MiB, 2.29% gc time)

but (in a new session):

julia> using FastGaussQuadrature

julia> @time p, w = gausslegendre(2);
  0.332452 seconds (231.99 k allocations: 12.070 MiB)

@fredrikekre
Copy link
Member Author

Okay, it boils down to gausslobatto not beeing type stable

@fredrikekre
Copy link
Member Author

@fredrikekre
Copy link
Member Author

#136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant