Skip to content

Draft: Performance optimization, bugfixes and cleanup

Martin Heistermann requested to merge mh_optimization into master

Good news up front: loading a benchmark file with 2M tets (no props) with bottom-up incidence generation goes from 18s down to 5s on my machine.

  • Fix some dangling references
  • Avoid lots of unnecessary copies
  • reserve() vectors where sensible
  • clean up code to make it more readable, e.g. new-style for-each loops, logic simplification

potentially breaking changes

  • Some likely inconsequential API changes: add_{face,cell} now take std::vectors instead of references to them. This avoids copies (as the refgerenced vector was always copied) and should not need any changes in downstream code.

  • adjacent_halfface_in_cell(hfh, heh) now assumes that the halfedge is part of the halfface's face. This is a reasonable assumption, but client code may have used it wrongly before and might break in that case. This was the case for a broken unittest.

TODO

  • Look into CI failure
  • make sure we reserve() when loading properties and measure results
  • Bump version to 2.2, add changelog entry (see notes above)
Edited by Martin Heistermann

Merge request reports