Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory allocations #37

Open
pmartorell opened this issue Jul 30, 2024 · 0 comments
Open

Reduce memory allocations #37

pmartorell opened this issue Jul 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pmartorell
Copy link
Collaborator

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.

@pmartorell pmartorell added the enhancement New feature or request label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant