Open koehlerson opened 1 year ago
We should also propagete function barriers and try to make a non-allocating version of e.g. function_value
. Also reinit seems to allocate for some reason. We also saw with Jet some possible instabilities in Ferrite.
TODO: We also need to investigate further the tradeoff between allocating extra arrays and maintaining performant cache access patterns.
after https://github.com/Ferrite-FEM/FerriteViz.jl/pull/70 and https://github.com/MakieOrg/Makie.jl/pull/2874 there isn't anything further to optimize if we don't have custom shaders
Its a little bit tricky with https://github.com/MakieOrg/Makie.jl/pull/2874 because this only dispatches on Makie.mesh
and not on our custom recipes as e.g. solutionplot, cellplot
etc. So the only thing which comes to my mind is to do namespace pollution in FerriteViz and tell explicitly that data_limits
from https://github.com/MakieOrg/Makie.jl/pull/2874 is valid for our recipes too
I also think that the remaining "performance issue" should be fixed in Makie itself, so everyone can benefit from it. However, for the surface plots I think the speed is fine enough for now, even for large plots. The other major bottleneck for "time to first plot" is https://github.com/Ferrite-FEM/Ferrite.jl/issues/617 , which should be fixed in Ferrite, such that also everyone benefits here.
Yes but my question is how we can forward the data_limits dispatches that I'm trying to add in Makie. In Makie I can only dispatch on the type of the basic mesh recipe
You mean e.g. for scatter? Or am I misunderstanding that this line https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/makieplotting.jl#L314 reaches the data_limits dispatch?
No it doesnt, since SF::FerriteViz.Surface
and this line https://github.com/Ferrite-FEM/FerriteViz.jl/blob/master/src/makieplotting.jl#L69 reaches the data_limits
dispatch with SP::FerriteViz.SolutionPlot
and not with Makie.Mesh
I think this can be closed?
Not sure. I think we should add some kind of benchmark here to monitor perf before marking this as resolved. What do you think?
With https://github.com/Ferrite-FEM/FerriteViz.jl/pull/63 we exploit something conceptually, however, the current implementation allocates rather much, because we run into
https://github.com/MakieOrg/Makie.jl/blob/adc9d9ae3523f746f9c32652c833a59bfc0167b2/src/conversions.jl#L581-L595
by e.g.
https://github.com/Ferrite-FEM/FerriteViz.jl/blob/59285b4e5ebeaf08f5b0dee25b181bf4d5ac96d3/src/makieplotting.jl#L95
where instead we could directly provide a
GLNormalMesh
which shouldn't allocate further according to Simon. If that's the case it is a bug in Makie and we could circumvent it by directly overloading recipe internals, such asdraw_atomic
. Besides that we could directly useMakie.Buffer
to construct theGLNormalMesh
in the spirit of https://docs.makie.org/stable/examples/plotting_functions/mesh/index.html#using_geometrybasicsmesh_and_buffersampler_type