Skip to content

Write reporter updates on a fixed interval #939

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

Closed
novemberborn opened this issue Jun 26, 2016 · 5 comments
Closed

Write reporter updates on a fixed interval #939

novemberborn opened this issue Jun 26, 2016 · 5 comments

Comments

@novemberborn
Copy link
Member

From npm v3.10.0 release notes:

The underlying code for the progress bar was rewritten, in part with performance in mind. Previously whenever you updated the progress bar it would check an internal variable for how long it had been since the last update and if it had been long enough, it would print out what you gave it. With the new progress bar we do updates at a fixed interval (with setInterval) and "updating" the progress bar just updates some variables that will be used when the next tick of the progress bar happens. Currently progress bar updates happen every 50ms, although that's open to tuning.

This seems like something we could do in AVA.

I imagine this is mostly useful for the mini reporter, which rewrites a single line. That said the verbose reporter still shows a spinner. We could hook the spinner into the drawing scheduler.

@vadimdemedes
Copy link
Contributor

Not sure this will bring any performance benefits for us, because our writes don't happen that often.

@novemberborn
Copy link
Member Author

I reckon they would for synchronous tests, but it'd require benchmarking, yes.

@sindresorhus
Copy link
Member

sindresorhus commented Jun 27, 2016

I think it's a good idea regardless, so not to overflow slow terminals (especially a problem with cmd.exe, ofc...). Should be easy to just write to a buffer instead and read from it on an interval. From experience anything between 50-100 ms is good.

@jamestalmage
Copy link
Contributor

There are test suites out there with many thousands of generated tests that happen very fast. From previous benchmarking, I know the mini reporter is much slower than the verbose one. It is doing way more calculations / writing control characters, etc.

@novemberborn
Copy link
Member Author

We should rewrite our reporters using ink. Still, we're OK at the moment. Closing to clean up the backlog.

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

No branches or pull requests

4 participants