Skip to content

Optimize ViewReader, NamedTupleParser, and Tuple for compile time and object size - #61

Closed
clockblocker wants to merge 1 commit into
cli-compile-time-and-cachefrom
optimize-view-reader-wrapper-peeling
Closed

clockblocker wants to merge 1 commit into
cli-compile-time-and-cachefrom
optimize-view-reader-wrapper-peeling

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Reduces template-instantiation count, object-file size, and DWARF debug info bloat for large reflected structs (such as 80+ field CLI configs):

  • Adds include/rfl/parsing/peel_transparent_wrappers.hpp: peels pure metadata/annotation wrappers (TransparentWrapper, Description, Deprecated, Short, Positional, Rename, DefaultVal) before calling Parser::read, so fields with the same underlying CoreType share a single read_field_core instantiation
  • Moves move_assign_field and placement_move_field out of ViewReader* class scope so instantiations don't encode the enclosing NamedTuple in mangled symbol names or DWARF info
  • Uses a constexpr sorted field-name table with binary search in ViewReaderWithDefault
  • Specializes NamedTupleParser::handle_one_missing_field on _defaults_constructed so default-constructed structs skip missing optional/DefaultVal codegen
  • Simplifies rfl::Tuple accessors to cut DWARF bloat and reuses the non-const to_view<S> instantiation in cli::usage

Stacked on cli-compile-time-and-cache (#60). Verified with ASan + UBSan across all CLI tests plus JSON test_wrapped_optionals_and_defaults and test_tuple.

@clockblocker
clockblocker force-pushed the optimize-view-reader-wrapper-peeling branch from 4270a29 to f0531bf Compare November 27, 2026 07:27
@clockblocker

Copy link
Copy Markdown
Owner Author

Superseded by #118 (perf-parser-symbol-isolation) + #119 (feat-rfl-metadata); closing fork PR (branch preserved).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant