Repository navigation
perf(parsing): isolate per-field parser helpers from enclosing NamedTuple/ViewType - #118
Closed
clockblocker wants to merge 4 commits into
Closed
clockblocker wants to merge 4 commits into
clockblocker wants to merge 4 commits into
Conversation
…uple/ViewType and optimize num_fields/ViewReader lookup
… Judge nits - Restore rfl::ExtraFields + schemaful::IsSchemafulReader static_assert guards in ViewReader::read(integral_constant) and assign_to_matching_index (chained with else if constexpr for NoExtraFields). - Factor field-name lookup into shared detail::FieldNameLookup<ViewType::Names> (linear scan for <=8 fields, constexpr std::sort + binary search for >8 fields). - Move new free helpers into rfl::parsing::detail and qualify internal calls to avoid ADL collisions. - Guard empty-struct size_ > 0 paths, tighten direct standard includes, drop unreachable set_schema_default_value recursion and unnecessary RFL_ALWAYS_INLINE. - Add edge-case unit tests in tests/json/test_parser_isolation_edge_cases.cpp.
…and parsed-JSON test assertions
This was referenced Nov 27, 2026
feat(schema): add opt-in zero-bloat rfl::Metadata<T> for out-of-band field/struct documentation
#119
Open
This was referenced Nov 29, 2026
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
clockblocker
added a commit
that referenced
this pull request
Dec 1, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
Owner
Author
|
Superseded by split queue PRs on the PR-keyed upstream queue (#209):
Closing this bundled PR. |
clockblocker
added a commit
that referenced
this pull request
Dec 2, 2026
…tors, and flatten Moves per-field serialization, schema building, missing-field handling, and destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free templates parameterized only on each field's type (never the enclosing `NamedTuple` pack), and skips instantiating destructors for trivially destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on wide structs with zero public API changes. Split from parser-symbol-isolation (#118) into an independent, reviewable chunk (no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader` isolation follow in separate commits). Follow-up to: munich-data-engineering#795, munich-data-engineering#799 Downstream receipts (combined Wave 1 N=3 interleaved medians vs main): - hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall - openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall - FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall - games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to munich-data-engineering#795 and munich-data-engineering#799 with zero public API changes. Isolates per-field parsing, writing, schema, and destruction helpers from enclosing
NamedTuple<FieldTypes...>/ViewTypepacks so symbol-table and DWARF debug-info size stop scaling quadratically ($O(N^2)$) with struct field count.Compile-time & binary impact
48-field
ConfigDatastruct (read + write + JSON schema, AppleClang 17 arm64, zero user code changes):.osize-O0 -g)-O2 -g)Key details
NamedTupleParser,ViewReader,ViewReaderWithDefault, and destructor helpers parameterized only by the individual field type rather than the full enclosingNamedTuple/ViewTypepack, skipping trivially destructible fields at compile time.FieldNameLookup) across readers, writers, and processors keyed only on the field-nameLiteralpack (linear scan for ≤ 8 fields,constexprheapsort + binary search above 8).cpp20::num_fieldswithAI-authored.