dimforge / dimforge/nalgebra

Improve performance in debug mode

Open
#484 5 comments 1 reaction 0 assignees View on GitHub
enhancement P-high performance
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

This issue originates from a request made by @happenslol [there](https://github.com/rustsim/nalgebra/issues/217#issuecomment-440804721).

Much effort has already be made to improve performance of nalgebra when compiled with full optimization (O3 and link-time optimization enabled). Now we should investigate how to improve performances in debug mode (or with low optimization levels). Here are two possible leads:

- Lack of explicit SIMD. Adding explicit SIMD to nalgebra could yield significant performance improvements.
- Non-zero cost abstractions in debug mode. Unfortunately, abstractions are zero-cost only when optimization are enable. We should investigate in particular the occurrence and cost of:
- Nested function calls.
- Indexing (unnecessary bound checking for statically-sized matrices).
- Debug assertions?
- Loops that are not unrolled.
- Trivial checks and branching that are not removed by the compiler (for example checks like [that](https://github.com/rustsim/nalgebra/blob/master/src/base/blas.rs#L198) are automatically evaluated at compile-time and removed by the optimizing compiler for statically-sized vectors).

I am not sure yet if we can make significant improvements using the stable version of the compiler. However, we could benefit from specialization and explicit SIMD using the nigthly compiler.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.