Repository navigation
perf(parsing): isolate per-field helpers in NamedTupleParser, destructors, and flatten - #228
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
clockblocker
force-pushed
the
queue/perf-named-tuple-parser-isolation
branch
from
December 2, 2026 13:26
aa35832 to
3a0cded
Compare
…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.
Related munich-data-engineering/reflect-cpp#795 · Related munich-data-engineering/reflect-cpp#799
Problem
Per-field write, schema, missing-field, and destructor helpers lived inside templates parameterized on the entire struct field pack.
An$N$ -field struct therefore emitted $N$ symbols each repeating all $N$ field types, causing $O(N^2)$ object-size and compile-time blowup.
Summary
effb0f7cand32f5fcfb(3-run medians vsmain, refl-cpp-workbench#34):.osize -15.0% (slang-server), -17.5% (moqx), and -27.1% (fanuc_driver)..osize -19.4% (wolf) and compile wall time -4.4% to -9.9%.For Agents
upstream-queue(7003ead7) · Score85/100(split) ·+298/-227(3f)