Repository navigation
perf(parsing): add type-erased descriptor-table core (TableStructParser) bypassing NamedTuple for aggregates - #125
Draft
clockblocker wants to merge 3 commits into
Draft
clockblocker wants to merge 3 commits into
clockblocker wants to merge 3 commits into
Conversation
…er) bypassing NamedTuple for aggregates - Add value-level DirectFieldNames<T, CasePipeline> with packed null-terminated char storage, sorted binary-search lookup, recursive rfl::Flatten support, and all 5 built-in case-transform processors (preserving xml_content and Rename). - Add non-T-parameterized TableViewReader / TableViewReaderWithDefault and shared driver loops in TableStructParser, eliminating NamedTuple, Tuple, and per-struct ViewReader/read_object instantiations across wide structs and multi-struct TUs. - Generalize bind_to_tuple into apply_to_fields (C++20 and C++26) and replace HasDefaultVal<named_tuple_t<T>> with direct apply_to_fields inspection. - Support rfl::ExtraFields, rfl::Flatten, custom/external named Readers (via SizedTableViewReader), env::Reader field_names(), xml is_view_reader_v, and RAII UninitFieldsGuard exception safety. - Add UBSan stress and regression test suites covering lifetime tracking, partial destruction, throwing readers, non-standard-layout aggregates, C-arrays, inheritance, Flatten, ExtraFields, and case-transform pipelines.
…eld short-circuit, and trivial-dtor skip
This was referenced Nov 29, 2026
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
Stacked on #118. Replaces the per-struct
NamedTuple<Field<StringLiteral, T>...>/ViewReaderinstantiation path for aggregate structs with a type-erased descriptor-table core (TableStructParser). Zero public API changes.Compile-time & runtime impact
AppleClang 17 arm64 (
origin/main→TableStructParser):.osizecamelCase+DefaultIfMissing)kebab-case+DefaultIfMissing)Description<..., DefaultVal>Flatten+ExtraFields+camelCaseRuntime
-O3JSON reads are 3.5–5.8× faster on wide structs (wide80_kebab_read: 10.0 → 1.7 µs;wide48_read_default: 3.7 → 1.1 µs) and near parity on writes (+0.5–3.3%).Key details
constexprbuffer + sorted lookup table keyed only by(CleanT, DirectCasePipeline), supporting recursiveFlatten,Rename, and all 5 built-in case-transform processors.TableViewReader*andread/write/to_schemadrivers once per(Reader, Writer, ProcessorsType)per TU instead of once per struct, using anExtraFields,Flatten, C-arrays, inheritance,const/move-only/non-default-constructible members,env::Reader, XML, and custom named readers (withHasNamedTupleFormatPolicyfallback).bind_to_tupleintoapply_to_fields(C++20 & C++26) and dropsnamed_tuple_t<T>fromHasDefaultVal<T>.AI-authored.