Repository navigation
perf(processors): eliminate redundant Tuple round-trip copies in case-transform processors - #240
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
…-transform processors Construct the renamed NamedTuple directly from its identical Values tuple via internal::from_values_tuple instead of round-tripping through NamedTuple::transform -> fields() -> apply -> make_from_tuple across all five case-transform processors: - NamedTuple.hpp: add minimal internal::from_values_tuple_t tag and explicit NamedTuple(internal::from_values_tuple_t, Values&& / const Values&) constructors on both NamedTuple<FieldTypes...> and NamedTuple<>. - internal/transform_case.hpp: add transform_case_field and transform_named_tuple_case (rvalue move and const-lvalue copy overloads) preserving xml_content, rfl::Rename, const fields, single-field nested NamedTuples, and empty NamedTuple<> behavior while enabling move-only field values. - SnakeCaseToCamelCase.hpp, SnakeCaseToPascalCase.hpp, SnakeCaseToKebabCase.hpp, CamelCaseToSnakeCase.hpp, ToAllCaps.hpp: forward auto&& _named_tuple directly to transform_named_tuple_case.
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.
Problem
All five field-casing processors rebuilt a
NamedTuplethrough.transform(...)and intermediate field tuples across five duplicated headers.That triggered redundant copies and moves on every field and blocked move-only fields altogether.
Summary
transform_named_tuple_caseand constructs the renamedNamedTupledirectly via internalfrom_values_tupleconstructors.xml_content,rfl::Rename,constfields, emptyNamedTuple<>, and lvalue copy semantics while unlocking move-only fields.-O0binary size -77%.OSS consumers
hudson-trading/slang-serverslang-serveropenmoq/moqxParsedConfig.hFor Agents
upstream-queue(5c994dbf) · Score85/100(S=24,M=26,D=22,R=13) ·+137/-124(7f)queue-tests/json/test_case_transform_zero_copy.cpp