-
Notifications
You must be signed in to change notification settings - Fork 269
Add container and tuple optimization helpers #3590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
tenpercent
wants to merge
3
commits into
develop
Choose a base branch
from
mpodkory/generate-tuple-optimizations
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+320
−4
Conversation
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
This was referenced Jan 16, 2026
59f0c32 to
5190578
Compare
885b80f to
0791bad
Compare
5190578 to
887bdf2
Compare
2 tasks
0791bad to
b26ed88
Compare
b26ed88 to
00849ac
Compare
887bdf2 to
02e42dc
Compare
82b6016 to
602c127
Compare
602c127 to
1713ea7
Compare
- Replace lambdas with named functors in container_concat - Add make_uniform_tuple helper for repeated value patterns - Add container_product helper with O(1) depth fold expression - Add merge_sequences_functor and unpack_and_merge_sequences - Add 16 unit tests for container helpers Co-Authored-By: Claude <noreply@anthropic.com>
47dfd5f to
99872ec
Compare
Detailed comments explain: - Why named functors reduce instantiations vs lambdas in container_concat - Impact: 50% reduction in container_concat (186 → 93 instantiations) - make_uniform_tuple optimization using pack expansion instead of lambda - generate_identity_sequences optimization for identity permutations - When to apply these patterns elsewhere This documentation helps maintainers understand the build-time optimization strategies and prevents reverting to less efficient patterns.
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
container_concatmake_uniform_tuplehelper for repeated value patternscontainer_producthelper with O(1) depth fold expressioncontainer_concatinstantiations from 186 to 93 (50% reduction)Why It Works
Lambda expressions in
container_concatcreated unique types at each call site. Themake_tuple_functornamed struct shares one type across all uses, halving instantiation count.The
make_uniform_tuplehelper eliminates repeated lambda instantiations for creating tuples with the same value repeated N times.Test Plan
container_concatandmake_uniform_tuplehelpersPR Stack
This PR is part of the build time optimization effort (issue #3575). All PRs now target develop independently:
__make_integer_seqTracking issue: #3575