You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
I am experimenting with the package for the first time, and noticed that the precompilation time is quite large:
julia>@timeaverage(gt); # first execution26.373887 seconds (206.77 M allocations:9.999 GiB, 3.68% gc time, 99.96% compilation time)
julia>@timeaverage(gt); # second execution0.014517 seconds (330.02 k allocations:18.696 MiB)
Should we add a precompilation script to get a better first-time experience?
Do you have a MWE for the above result? I've noticed some suboptimal compilation times before but 26 seconds for a first-use is definitely not a great experience.
I'd considered working on precompilation before but didn't know enough about it to have a good sense of what would actually be beneficial, e.g. will the precompiled code remain valid/useful for non-identical integrand functions?
using Meshes
using MeshIntegrals
functionintegrand(tri::Triangle, f)
p ->let# retrieve vertices
v =vertices(tri)
# linear system for barycentric coordinates
A = [(v[2] - v[1]) (v[3] - v[1])]
b = (p - v[1])
# normalize by maximum absolute coordinate
m =maximum(abs, A)
Aₘ = A / m
bₘ = b / m
# solve for barycentric coordinates
w₂, w₃ = Aₘ \ bₘ
# linear interpolation inside triangle
f[1] + w₂ * (f[2] - f[1]) + w₃ * (f[3] - f[1])
endend
t =rand(Triangle)
@timeintegral(integrand(t, [1, 2, 3]), t, GaussLegendre(2));
The actual example repeats this call for all triangles in a mesh. You can find the test here and the definition of the average function here.
Didn't have a chance to test it yet. Hopefully it is much faster now. We
should transfer the issue to Meshes.jl otherwise.
Em qua., 8 de abr. de 2026, 15:25, Joshua Lampert ***@***.***>
escreveu:
Activity
mikeingold commentedon Feb 2, 2026
Do you have a MWE for the above result? I've noticed some suboptimal compilation times before but 26 seconds for a first-use is definitely not a great experience.
I'd considered working on precompilation before but didn't know enough about it to have a good sense of what would actually be beneficial, e.g. will the precompiled code remain valid/useful for non-identical integrand functions?
juliohm commentedon Feb 2, 2026
Hi @mikeingold, thank you for looking into it.
Below is a MWE with a single triangle:
The actual example repeats this call for all triangles in a mesh. You can find the test here and the definition of the
averagefunction here.JoshuaLampert commentedon Apr 8, 2026
This is much better with the version in Meshes.jl v0.57, right?
juliohm commentedon Apr 8, 2026