Skip to content

Geometry objects should not hold their transformation matrices as shared pointers (was ACTS-292)

Original author Christian Gumpert @cgumpert

Transformation matrices are almost always unique to each geometry object as it contains both, translation as well as rotation. So using {{std::shared_ptr}} here does not actually reduce the memory footprint but still leads to some small (hypothetical) performance loss. Instead, transformations should be stored either as {{unique_ptr}} or by value. The latter option is preferable in terms of data locality. However, many geometry objects may have a trivial transformation matrix (= the identity matrix), e.g. concentric cylinder layers. In this case, applying the identity matrix can lead to a performance degradation while with unique pointers one could indicate with a {{nullptr}} that no transformation is required.

Edited by Moritz Kiehn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information