Nef 3: performance gain using std::variant for Object_handle - #9557
Nef 3: performance gain using std::variant for Object_handle#9557GilesBathgate wants to merge 5 commits into
Conversation
Its 7% to 8% improvement using the intersection of a shifted grid of spheres, but I need to fix for Nef_2 before submitting the final PR. |
c3278c0 to
b353dd6
Compare
|
Successfully tested in CGAL-6.3-Ic-31 |
|
@afabri if there is no public API, I'd got for a direct replacement, no wrapper. |
|
@sloriot / @afabri I make the wrapper to be compatible with the public api exposed by locate: https://doc.cgal.org/latest/Nef_3/Nef_3_2nef_3_point_location_8cpp-example.html |
@afabri if |
|
@sloriot Deprecating |
|
I would go for adding |
Summary of Changes
Refactored CGAL::Object_handle within the Nef_2, Nef_3, and Nef_S2 packages to use an std::variant based approach. This introduces dependency injection for Object_handle instantiation, replacing explicit make_object(...) function calls with direct template constructors (e.g., Object_handle(...)) across several key subcomponents.
Switching from the std::shared_ptr<boost::any>> to std::variant<std::monostate,...> achieves a 7% to 8% performance improvement when processing the intersection of a shifted grid of spheres, while utilisng the same memory footprint.
Key modifications include:
Release Management