Skip to content

make STDEXEC_ATTRIBUTE dispatch on arity instead of recursing - #2605

Merged
ericniebler merged 1 commit into
NVIDIA:mainfrom
ericniebler:faster-stdexec-attribute-macro
Dec 6, 2026
Merged

ericniebler merged 1 commit into
NVIDIA:mainfrom
ericniebler:faster-stdexec-attribute-macro

Conversation

@ericniebler

Copy link
Copy Markdown
Collaborator

STDEXEC_PP_FOR_EACH rescans its argument 256 times per use, and STDEXEC_ATTRIBUTE has ~670 uses. Dispatching on the argument count (0-4) halves the time to preprocess <stdexec/execution.hpp> (clang 0.35s -> 0.17s, GCC 0.55s -> 0.25s). Passing more than 4 attributes is a compile-time error.

STDEXEC_PP_FOR_EACH rescans its argument 256 times per use, and
STDEXEC_ATTRIBUTE has ~670 uses. Dispatching on the argument count
(0-4) halves the time to preprocess <stdexec/execution.hpp>
(clang 0.35s -> 0.17s, GCC 0.55s -> 0.25s). Passing more than 4
attributes is a compile-time error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ericniebler
ericniebler force-pushed the faster-stdexec-attribute-macro branch from e2ded05 to 7f6e076 Compare December 6, 2026 00:27
@ericniebler ericniebler changed the title make STDEXEC_ATTRIBUTE dispatch on arity instead of recursing make STDEXEC_ATTRIBUTE dispatch on arity instead of recursing Dec 6, 2026
@ericniebler
ericniebler merged commit a2374a3 into NVIDIA:main Dec 6, 2026
46 checks passed
@ericniebler
ericniebler deleted the faster-stdexec-attribute-macro branch December 6, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant