Skip to content

Reduce memory allocations #37

@pmartorell

Description

@pmartorell

The principal computational cost of the main loop is due to fine-grained memory allocations. These allocations are generally in the clip and split procedures that allocate new GeneralPolytope at each execution.

In order to reduce these allocations, it may be convenient to add an optional cache to clip and split. The caches must be created outside the main loop of subtriangulate. We need to take into account that the number of polytopes per background cell is not bounded. Thus, the cache is indeed an array of caches.

Additionally, it is convenient to eliminate the recursivity of decompose using a stack instead.

We note that this is a major refactoring of the code that involve many procedures. In addition, before proceeding, an extensive profiling should be done to identify other memory allocations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions