Skip to content

[Feature]: Replace boost::variant by boost::variant::variant2 #2819

@jorisv

Description

@jorisv

🚀 Feature

Replace boost::variant by boost::variant::variant2 to modernize the code base.

This is not mandatory and will break the public API so this feature will be implemented for Pinocchio > 4.

Motivation

Simplify the code base:

  • Use lambda instead of Boost::fusion and custom visitors
  • Remove BOOST_MPL_LIMIT_LIST_SIZE and BOOST_MPL_LIMIT_VECTOR_SIZE define
  • Remove Boost::fusion

Improve build time

crba, rnea, aba and kinematics build benchmark:

  • variant
    • 58.79s user 2.71s system 293% cpu 20.936 total
    • 908K src/libpinocchio_default.so.3.8.0
    • Memory: 1992M
  • variant2
    • 46.83s user 2.14s system 255% cpu 19.148 total
    • 896K src/libpinocchio_default.so.3.8.0
    • Memory: 1716M

Total build time is reduced, but parallel build time is not because aba.cpp is mainly Eigen3 template instantiation bound.

Alternatives

No response

Additional context

No response

Checklist

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions