Skip to content

"Performance Tips" documentation #2758

Open
@mscroggs

Description

@mscroggs

Describe new/missing feature

We should add a performance tips/pitfalls section to the docs, including:

  1. Don't put form in loops
    • How to avoid it using dolfinx.fem.Constant and reassigning of dof-values in functions
  2. Avoid data allocation inside loops
    • Explain sparsity pattern creation and matrix creation
    • Also is the same for dolfinx.fem.Function and PETSc.Vector
  3. Don't create linear solver as it does all of the above (and creating the PETSc ksp object).
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation improvements or fixesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions