Skip to content

Improve Mesh_3 memory footprint#9331

Open
MaelRL wants to merge 92 commits intoCGAL:mainfrom
MaelRL:Mesh_3-memory-culling-GF
Open

Improve Mesh_3 memory footprint#9331
MaelRL wants to merge 92 commits intoCGAL:mainfrom
MaelRL:Mesh_3-memory-culling-GF

Conversation

@MaelRL
Copy link
Copy Markdown
Member

@MaelRL MaelRL commented Feb 17, 2026

heaptrack | vtune | usr/bin/time

  • mesh vertex base: number_of_incident_facets_ and number_of_components_ to int (or even smaller)?
  • get rid of sliver_value and use a local unordered_map<Cell_handle, sliver_value> in the optimizers?
  • get rid of subdomain index? ==> could be interesting because not all cells are in the domain, due to alignment, we gain nothing at the moment
  • canonical facets in the C3T3 map (more complex than it seems: the canonical facet could be in the conflict zone, but the information shouldn't be lost when it's removed from the complex, before the creation of a new facet)
  • can gain a little bit with writing a compact_mesh_vertex_3: there is a for example a Boolean in the TDS vertex base
  • Reduce the size of Point_3*? In sequential it's straightforward (e.g. quietNaN), but concurrent? But it's only stored for cells in complex, so is it worth it (3 doubles always vs 1 always and 1+3 often)
  • MISC: Can have memory leaks in parallel if multiple new circumcenters at the same time?

TODO:

The point is that in cell bases, we store facet info at great memory
cost given that only a small fraction of the facets are surface (i.e.,
part of the complex / restricted) facets.
WIP: available with both cell member API and map API
- Get rid of the caches: squat the value -2
- Re-order class member to use as few bytes as possible
I need access to the C3T3 member functions.

This could be restricted to surface facet criteria only,
but might as well do it for everything.
- Do not use a base_base
- Avoid the sliver cache: all values are positive, so squat -2
  as a cache.
- Do not use surface info arrays, use the C3T3 maps
- Re-order for byte padding
@MaelRL MaelRL force-pushed the Mesh_3-memory-culling-GF branch from 7532b99 to 38626ba Compare February 18, 2026 12:15
@MaelRL MaelRL force-pushed the Mesh_3-memory-culling-GF branch from 1bd040f to b5357bf Compare February 18, 2026 16:39
MaelRL added 2 commits March 27, 2026 15:54
And fix it for cases where storage is within the hash map
@MaelRL MaelRL force-pushed the Mesh_3-memory-culling-GF branch from 24ae5a4 to 1c7556c Compare March 27, 2026 15:08
@MaelRL MaelRL added the TODO label Apr 8, 2026
@sloriot
Copy link
Copy Markdown
Member

sloriot commented Apr 19, 2026

MSVC2017 has a compilation issue:
https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-6.2-Ic-157/Generator/TestReport_Christo_MSVC2017-Release-64bits.gz

 C:\CGAL_ROOT\CGAL-6.2-Ic-157\include\CGAL/Mesh_3/sliver_criteria.h(162): error C2327: 'CGAL::Mesh_3::Sliver_criterion<Tr,Cache,CGAL::Mesh_3::Sliver_caching_policy::BELOW_BOUND,std::vector<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::Compact_mesh_cell_3<CGAL::Point_3<Kernel_>,CGAL::Weighted_point_3<Kernel_>,Subdomain_index,Surface_patch_index,Index,TDS2>,CGAL::Default,CGAL::Default,CGAL::Default>,false>,std::allocator<_Ty>>>::caching_policy': is not a type name, static, or enumerator [C:\CGAL_ROOT\CGAL-6.2-Ic-157\cmake\platforms\MSVC2017-Release-64bits\test\Generator\generic_random_test.vcxproj]

@sloriot
Copy link
Copy Markdown
Member

sloriot commented Apr 22, 2026

Testsuite looks good in Successfully tested in CGAL-6.2-Ic-160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

depends on another PR This pull-request should only be merged after other ones. Not yet approved The feature or pull-request has not yet been approved. Pkg::Mesh_3 Ready to be tested Tested TODO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants