Skip to content

Binary size is enormous #465

@rgov

Description

@rgov

I built ros1_bridge (from the foxy branch) with a total of 250 message definitions, many of them custom but none particularly complex. The command to build was:

RUN /bin/bash -c " \
    source /opt/ros/${ROS1_DISTRO}/setup.bash && \
    source /opt/ros/${ROS2_DISTRO}/setup.bash && \
    source /app/install/setup.bash && \
    source /ros2_msgs_ws/install/local_setup.bash && \
    cd /bridge_ws && \
    MAKEFLAGS=-j1 colcon build \
        --packages-select ros1_bridge \
        --cmake-force-configure \
        --event-handlers console_cohesion+ \
    "

This produced the file ros1_bridge/lib/libros1_bridge.so which weighs in at 392 MB. That's 1.6 MB per message type.

It seems like there is a problem with the amount of code being generated. Adding --cmake-args -DCMAKE_BUILD_TYPE=Release shrinks it down to 82 MB which is a lot better in comparison, but still seems large.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions