Repository navigation
perf(schema): fast-path scalar defaults in NamedTupleParser::to_schema - #237
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
This was referenced Dec 2, 2026
clockblocker
force-pushed
the
queue/perf-schema-scalar-defaults
branch
from
December 2, 2026 13:26
3c00022 to
a8bed5d
Compare
Adds `rfl::parsing::to_default_generic` so scalar and `std::optional<scalar>` default values (`bool`, plain integers, floating-point, `std::string`) construct `rfl::Generic` directly during JSON Schema emission instead of instantiating `rfl::to_generic<ProcessorsType>` / `rfl::generic::Writer`, while keeping complex types on `rfl::to_generic` with identical semantics. Parent: depends on `perf(parsing): isolate per-field helpers in NamedTupleParser, destructors, and flatten` for `build_named_tuple_field_schema`. Judge polish applied: - Drops the consumer-specific `std::vector<std::string>` special case (falls back cleanly to `rfl::to_generic`) and documents parity with `rfl::generic::Writer::to_generic`.
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#641
Problem
Every
rfl::DefaultVal<T>field in a schema-generating struct instantiated the fullrfl::to_genericandrfl::generic::Writerpipeline.That pulled in heavy template instantiations just to convert trivial scalar defaults into
rfl::Generic.Summary
bool, plain integers, floating-point types,std::string, andstd::optionalwrappers around them while matchingrfl::generic::Writersemantics.rfl::to_genericfor composite or custom defaults (structs, vectors, maps) with identical schema output.For Agents
upstream-queue(bfe34018) · Score82/100(split) ·+39/-1(1f)queue-tests/json/test_named_tuple_parser_isolation.cpp