-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Only flush output frequently for ProgressFormatter #2541
Conversation
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.
Looks good. Some nitpicks. Don't forget to add an entry to the changelog.
core/src/main/java/io/cucumber/core/plugin/UnusedStepsSummaryPrinter.java
Show resolved
Hide resolved
Changelog entry added by commit 6d01075 |
Codecov Report
@@ Coverage Diff @@
## main #2541 +/- ##
============================================
+ Coverage 84.45% 84.50% +0.04%
- Complexity 2651 2655 +4
============================================
Files 310 310
Lines 9324 9337 +13
Branches 896 898 +2
============================================
+ Hits 7875 7890 +15
+ Misses 1116 1115 -1
+ Partials 333 332 -1
Continue to review full report at Codecov.
|
99ebad6
to
9d742cd
Compare
9d742cd
to
d2722a8
Compare
Hi @scottadav, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
Cheers! |
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
For the sake of efficiency and performance we write to buffered writers. However, the pretty plugin is expected to print scenarios as they're started and steps as they're finished. This was initially resolved by flushing the `NiceAppendable` on every write. This turned out to have performance impact (#2481) and interact poorly with tools that expected (#2536) us to be better behaved. By having `NiceAppendable` flush only when the underlying buffer was full these problems were resolved (#2541) . However, because the underlying buffer is 8KiB the pretty formatters output would effectively sit in a buffer until the writer was closed. So now we flush the pretty and progress output manually after each event. This strikes a balance somewhere between the flush-everything-all-the-time and flush-when-full approaches. Fixes: #2563
🤔 What's changed?
⚡️ What's your motivation?
This fixes #2481 and #2536
I am only concerned with #2536, but this fixes both issues at once.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Just make sure it meets project standards and that the change looks acceptable to the reviewers. I'm don't know the project's branching standards. Feel free to modify anything as needed, or you can send it back to me with instructions. Whatever works. Thanks!
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.