Repository navigation
perf(parsing): add DirectStructParser bypassing NamedTuple/Tuple for plain aggregates - #124
Closed
clockblocker wants to merge 3 commits into
Closed
clockblocker wants to merge 3 commits into
clockblocker wants to merge 3 commits into
Conversation
…Collector, found_count fast path, noexcept read_with_default, deduplicated readers, expanded tests)
…ay partial-destruction test)
Owner
Author
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 → #119. Adds
DirectStructParserso eligible plain aggregate structs bypassrfl::NamedTuple,rfl::Tuple,ViewReader, andNamedTupleParserduringread,write, andto_schema— eliminating per-structNamedTupletemplate instantiations with zero public API changes.Compile-time & binary impact
AppleClang 17 arm64 (
-O2 -g, uncontended CPU, vs#118+#119):.osizeNamedTuplesymbolsslang-serverSlangServer.cppslang-serverConfig.cppConfigData(-O0 -g)Runtime JSON throughput (
-O2, 48-field struct) stays within ~1.3 ns/field (read98 vs 106 ms,write61 vs 66 ms over 50k iterations).Key details
constexprstring buffer +std::array<std::string_view, N>(DirectFieldNames<T>) instead ofrfl::Literal<...>type lists.apply_to_fieldsand drivesread/write/to_schemathrough a tiny per-structDirectFieldDescfunction-pointer table with shared non-Tdriver loops.NamedTupleParserforFlatten,ExtraFields, custom name-transform processors,env::Reader, and schemaful/positional readers).AI-authored.