Open
Description
Describe new/missing feature
We should add a performance tips/pitfalls section to the docs, including:
- Don't put form in loops
- How to avoid it using
dolfinx.fem.Constant
and reassigning of dof-values in functions
- How to avoid it using
- Avoid data allocation inside loops
- Explain sparsity pattern creation and matrix creation
- Also is the same for dolfinx.fem.Function and PETSc.Vector
- Don't create linear solver as it does all of the above (and creating the PETSc ksp object).
- Usage of form compiler and jit options (cache control and optimization), ref https://jsdokken.com/dolfinx-tutorial/chapter4/compiler_parameters.html
(Suggestions for more things to include welcome)
Numba have something similar: https://numba.readthedocs.io/en/stable/user/performance-tips.html