Skip to content

Conversation

@cowboyd
Copy link
Member

@cowboyd cowboyd commented Jan 13, 2026

Motivation

There are certain cases where having highly recursive calls can cause slowdowns. This is a stab at optimizing that.

@taras
Copy link
Member

taras commented Jan 13, 2026

Did you decide to rename chain to start-optimization? what does start-optimization mean?

@cowboyd
Copy link
Member Author

cowboyd commented Jan 13, 2026

@taras its "star" optimization, as in ⭐

The reason is that it is an optimization of the yield* syntax, which can cause a performance degradation when there are many, many levels of recursion.

The idea is that we can roll up any number of levels of recursion into a single yield point by transforming:

yield* operation;

into

yield star(operation);

@taras
Copy link
Member

taras commented Jan 13, 2026

Is the readme unrelated?

There are certain cases where having highly recursive calls can cause
slowdowns. This is a stab at optimizing that.
@cowboyd
Copy link
Member Author

cowboyd commented Jan 13, 2026

Yeah, I just copied it over from chain. I was working on this, but wanted to push up my work so I wouldn't lose it. I've updated the readme.

Note that this won't pass the tests because it is v4 only.

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.

2 participants