Skip to content

Investigating reducing compile time impact of Reflection.hpp #1149

@gennaroprota

Description

@gennaroprota

Alan suggested investigating whether compile times can be reduced for translation units that include Reflection.hpp, which currently requires parsing all metadata-related includes due to BOOST_DESCRIBE_xxx() invocations.

Background

This issue originated from a discussion in PR #1130. Currently:

  • Struct and enum definitions live in public include files.
  • BOOST_DESCRIBE_xxx() invocations live in Reflection.hpp (private, under src/lib/).
  • Only .cpp files in src/lib/ include Reflection.hpp (currently ~4 files).

While this design already provides reasonable separation, there may be opportunities to further reduce compile time overhead.

Questions to investigate

  • Can we forward-declare the internal entities that BOOST_DESCRIBE_xxx() generates?
  • Could we create a macro that forward-declares whatever entities the describe macros would create?
  • Are there other techniques to encapsulate the describe metadata without requiring full definitions?

Additional considerations

Personally, I'm not fond of a solution that requires knowing the implementation details of Boost.Describe, especially since we are not having an issue with compile times.

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