Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for TC-39's async iteration proposal? #10

Closed
jacoscaz opened this issue Oct 1, 2018 · 6 comments
Closed

Support for TC-39's async iteration proposal? #10

jacoscaz opened this issue Oct 1, 2018 · 6 comments
Assignees
Labels

Comments

@jacoscaz
Copy link
Collaborator

jacoscaz commented Oct 1, 2018

Would it be possible to extend asynciterator to support TC-39's async iteration proposal? It is starting to be implemented by browsers and has landed as a new way to consume streams in Node.js 10.x .

@RubenVerborgh
Copy link
Owner

I might add interface support, but (and this is a bit but) async iteration is a lot slower than asynciterator. It has been a deliberate choice to develop asynciterator, even though the asyc iteration effort was going on, for performance reasons.

So while you could then for await over an AsyncIterator, it would not be the preferred way in performance-critical applications.

My colleague @joachimvh did some testing earlier this year: LinkedDataFragments/HDT-Node#9 (comment)

@RubenVerborgh RubenVerborgh self-assigned this Oct 1, 2018
@jacoscaz
Copy link
Collaborator Author

jacoscaz commented Oct 1, 2018

@RubenVerborgh I see! Thank you for pointing me to that.

@slikts
Copy link

slikts commented Oct 6, 2018

The linked comment seems to talk about testing the transpiled versions of async generators, though; the native performance should be better.

@RubenVerborgh
Copy link
Owner

@joachimvh Do we have native performance tests?

@joachimvh
Copy link
Collaborator

I just removed the transpilation step now and it did improve but is still much slower than AsyncIterator (usual disclaimer of this not being the most extensive tests ever etc.)

@LaurensRietveld
Copy link

Perphaps relevant for this discussion: node 10 has (experimental) support for using a readable stream as an async iterator. This would not solve any possible performance issue, but it could mean we wouldnt have to implement an async iterator interface and a streaming interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants