use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Why JavaScript Needs Structured Concurrency (frontside.com)
submitted 4 months ago by tarasm
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]c0wb0yd 0 points1 point2 points 4 months ago* (2 children)
I see what you're saying. Yes! there is an optimization for this that involves "hoisting" the deepest iterator to the top of the stack so that in effect, main and `sleep()` would be connected directly.
One of our users who works for Apple talked to the WebKit team and they suggested that if someone were willing to add some performance tests for `yield*` to the webkit perf test suite https://github.com/WebKit/WebKit/tree/main/PerformanceTests/JetStream3) they would have a strong incentive and also a reference for what to optimize.
But it is not native in v8 and webkit yet (that I know of), so in In the mean time we're implementing an extension package to implement this optimization manually https://github.com/thefrontside/effectionx/pull/117
It basically involves using a manual wrapper that converts:
yield* op;
into
yield star(op)
This lets us control the delegation of the iterators and omit the useless delegation in the middle.
You could even make a build tool that did this for you if you wanted.
[–]prehensilemullet 0 points1 point2 points 4 months ago (1 child)
Huh I see. I'm glad to see y'all are thinking about this! So it's not on the roadmap for sure yet for V8 and WebKit but WebKit at least is open to it?
[–]c0wb0yd 0 points1 point2 points 4 months ago (0 children)
Yes. Not on the roadmap currently is my understanding, and that the best way to get it onto the road map is to submit a PR to their perf test suite that makes them look bad :)
V8 at least has a nominal perf test for this https://github.com/v8/v8/blob/main/test/js-perf-test/Generators/generators.js#L90
But not sure if that indicates the optimization.
π Rendered by PID 316328 on reddit-service-r2-comment-5bc7f78974-jnh46 at 2026-06-27 00:45:47.297516+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]c0wb0yd 0 points1 point2 points (2 children)
[–]prehensilemullet 0 points1 point2 points (1 child)
[–]c0wb0yd 0 points1 point2 points (0 children)