Benchmarking and status update
While accurate and reproducible code is an integral part of any scientific software package, if it cannot be run in a reasonable timeframe, it can be worthless. In this blog post we will present timing results, of some Finite Element calculations across different frameworks/implementations and discuss the results. For reference, we are considering the following problem, the Poisson Equation with Dirichlet Boundary Conditions on the unit square (denoted as $D$), although arbitrary domains can be handled. This also matches tutorial 1 provided by FEniCS.
We present timings of FEniCS, FEniCS.jl and two Julia implementations, one of which has been partially optimized for speed. To do this, we have used macros such as @inbounds when performing array calculations and removing the zeros from our sparse matrix before solving the linear system. The two Julia implementations rely on FEniCS.jl for its meshing capabilities, although other software could provide the same functionality. This also demonstrates the extensibility of our currently implemented framework, as a basis for other software packages. For the setup, we have run each calculation 5 times, and taken the minimum runtime of each calculation. This is to provide more consistent results, and to reduce any noise present. If more computing power was available, we could take more calculations for an even more accurate estimate.
|Number of Vertices|
By examining the data in the above table, one can see that the FEniCS and FEniCS.jl timings are extremely close to each other, with a small overhead due to PyCall.jl. This demonstrates, that from a performance point of view, there is no significant downside in using FEniCS.jl over FEniCS. The pure Julia implementations are much faster, particularly the optimized one, which in some cases, has an over factor two speedup compared to FEniCS. At the same time, some care must be taken. We have only provided data for one class of problems, namely the Poisson Equation stated in [Equation:Poisson], which is fairly straightforward to describe and solve. While our currently implemented Julia code can handle arbitrary boundary conditions and forcing functions it cannot support other equations without some changes, whereas for FEniCS this is fairly straightforward.
Furthermore, some work has also been done on cleaning up code, especially regarding type aliases, and some small fixes regarding some snippets of code, which could (and probably should) be regarded as type piracy. Finally work has been done on direct Julia plotting capabilities. We currently rely on PyPlot, but other plotting backends, such as Makie.jl will be investigated.