- Notifications
You must be signed in to change notification settings - Fork1.9k
[MAJOR VERSION] Async iterators#1135
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This reverts commit343cc31.
All the tests are green - I'm really excited what you think of this approach@Siemienik@guyonroche If we like it, I would love to add support for it our streaming reader, as well, so that the consumers of our library can use for-await-of on the streams that we expose ... and make our streams destroyable without creating memory leaks ;) |
And here are the benchmarking numbers. First, current
And after this PR:
In short, we have a slight slowdown (3-4%), but lower memory usage and much simpler control flow in our code, making it more maintainable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ok, so we are waiting for v3.9.3 has been published
Uh oh!
There was an error while loading.Please reload this page.
# Conflicts:#README.md#README_zh.md#lib/xlsx/xlsx.js
…ators# Conflicts:#README.md#lib/xlsx/xlsx.js
I found and fixed another issue with the zip iteration (seeZJONSSON/node-unzipper#191) and have also deprecated CSV#createInputStream |
# Conflicts:#package.json
I've resolved all merge conflicts, this PR is now ready to be merged |
it('should fail fast on a huge file',function(){ | ||
this.timeout(20000); | ||
this.timeout(5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This test is currently super flaky onmaster
, this PR fixes it - and so confidently, that we can decrease the timeout from 20s to 5s
@guyonroche can we please merge this? |
# Conflicts:#README.md#README_zh.md#lib/xlsx/xlsx.js
Uh oh!
There was an error while loading.Please reload this page.
This PR is the result of a lot of groundwork laid by previous PRs#1127#1125#829#1142#1190#1140#1139#1142
I'm happy to report that this PR adds 200 lines of documentation and deletes over 400 lines of code while keeping all tests green, maintaining performance and at the same time making our code base much easier to reason about and maintain.
I've thrown out everything related to streams & custom flow control logic around that and replaced it with generators (sync wherever possible, async when necessary). I exposed one external stream API at the end, built on the generators underneath.
This PR is now ready to be merged. It supports node v8 via the es5 import.
Here is the new usage: