Skip to content

Performance Issue: memory and performance optimisation in point.h #434

@VyasGuru

Description

@VyasGuru

Point class: missing += / -= overloads and inefficient squared_length() implementation

There are two places in point.h which are implemented inefficently:

1. Missing operator+= and operator-=

This causes temp variables to be made, which hurts efficiency.

Overloading these will sovle this issue.


2. Inefficient squared norm calculation

Currently we are calling length() and then squaring the result to get squared norm. This is terrible because we calculate a squareroot only to square it again.

We can simply use eigen's method squaredNorm() which would make this much faster.


I am planning to address both of these issues in a pr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions