question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pretty print plugin performance issues

See original GitHub issue

Pretty print plugin is slow, because:

  • Calls flush method on every printed line.
  • Use unbuffered output stream.

Combination of previous points results in poor performance. In my situation the plugin doubles the run time.

Single thread

When running Cucumber tests in a single thread, the bottleneck is in the OutputStreamWriter.flush() method.

cucumber-junit5-pretty-print-issue-sample-singlethread

Multi-threading

When running Cucumber tests in multiple threads, the bottleneck is still in the flush() method. Because printing is called from synchronised SynchronizedEventBus.send() method, a thread has to wait for flush() in other threads, which subsequently kills performance gains from multi-threaded solution.

cucumber-junit5-pretty-print-issue-sample-multithread

Expected behaviour

Performance of the NiceAppendable class should be improved to be close to running tests without the plugin. A good idea may be not to flush on every line.

  • Version: io.cucumber:cucumber-java:7.2.3
  • Tests executed from IntelliJ IDEA 2021.3.2
  • Build tool: Gradle 5.3.1
  • OS: macOS Monterey 12.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
mpkorstanjecommented, Feb 10, 2022

Very interesting. I’ll have to take a good look.

0reactions
mpkorstanjecommented, Apr 30, 2022

@vkuzel https://github.com/cucumber/cucumber-jvm/pull/2541 should be released in a few minutes. Would you mind giving it a try?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pretty print is slow (linearalized xml 10MB) · Issue #55 - GitHub
I have made a replacement for the pretty print functionality. It also handles the linearize functionality. For my 10MB file, the processing time ......
Read more >
Notepad ++ not responding when saving XML file - Community
When I attempt to save an XML file after editing it with the plugin “XML tools” the program goes not responding and crashes....
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
Methods for linting and pretty-printing your code; Remove conflicting rules and run serially; Run Prettier followed by ESLint programmatically ...
Read more >
prettyprint XML download | SourceForge.net
Download prettyprint XML for free. prettyprint XML provides a ... Application performance monitoring helps engineering teams pinpoint issues ...
Read more >
make XML pretty - formatting - Stack Overflow
After installing the plugin from Plugins/Plugins Admin..., click Plugins/XML Tools/Pretty print or just use Ctrl+Alt+Shift+B, or Ctrl+Alt+Shift+A ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found