Skip to content

perf: type-stable ReservoirChain collectstates - #572

Merged
MartinuzziFrancesco merged 1 commit into
masterfrom
fm/fix-chain-collectstates-stability
Nov 1, 2026
Merged

MartinuzziFrancesco merged 1 commit into
masterfrom
fm/fix-chain-collectstates-stability

Conversation

@MartinuzziFrancesco

Copy link
Copy Markdown
Collaborator

Recurse over the layer tuple instead of filling an Any[] so collectstates infers concretely; ~3x fewer allocations on chains with one or more Collect layers.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Recurse over the layer tuple instead of filling an Any[] so collectstates
infers concretely; ~3x fewer allocations on chains with one or more Collect
layers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MartinuzziFrancesco
MartinuzziFrancesco merged commit 284c36b into master Nov 1, 2026
60 checks passed
@MartinuzziFrancesco
MartinuzziFrancesco deleted the fm/fix-chain-collectstates-stability branch November 1, 2026 19:04
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