Skip to content

⚡️ Implement action as a pure iterator - #1175

Merged
cowboyd merged 1 commit into
v4from
iterator-action
Jun 5, 2026
Merged

⚡️ Implement action as a pure iterator#1175
cowboyd merged 1 commit into
v4from
iterator-action

Conversation

@cowboyd

Copy link
Copy Markdown
Member

Motivation

action() is a hot path and any savings to be. had here will payoff in multiples.

Approach

We can implement action as a direct Iterable using a Do() effect and not pay the overhead of allocating a generator frame.

Since this is a hot path, we can implement as a Do() effect and not
pay the overhead of allocating a generator frame.
@pkg-pr-new

pkg-pr-newBot commented Jun 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/effection@1175

commit: 3ecb15a

@codspeed-hq

Copy link
Copy Markdown

Merging this PR will improve performance by 26.95%

⚡ 1 improved benchmark
✅ 5 untouched benchmarks
⏩ 18 skipped benchmarks1

Performance Changes

ModeBenchmarkBASEHEADEfficiency
Memoryeffection.events156 KB122.9 KB+26.95%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing iterator-action (3ecb15a) with v4 (d326678)

Open in CodSpeed

Footnotes

  1. 18 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cowboyd
cowboyd merged commit 82bd953 into v4Jun 5, 2026
19 checks passed
@cowboyd
cowboyd deleted the iterator-action branch June 5, 2026 18:21
@cowboydcowboyd mentioned this pull request Jul 8, 2026
Sign up for freeto 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.

2 participants

@cowboyd@jbolda