Skip to content

Allow opting-out of CustomDebugStringConvertible to reduce binary size #1245

@bubski

Description

@bubski

This observation comes from researching #1204.

It appears that CustomDebugStringConvertible's contribution to the binary size adds up and is not insignificant.
A quick check shows that removing it from Message, SimpleExtensionMap, AnyExtensionField would save us ~800kB.

For context, our project has around 1000 message definitions.
This was a modified version 1.17.0,
compiled with -Osize,
Xcode 13.2.1 13C100, Swift 5.5.2, Big Sur

Since conforming to CustomDebugStringConvertible does not seem essential, perhaps it could could be tied to a compilation flag?
I'd like to hear some initial feedback @thomasvl before getting into details.

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