I am required to print huge amounts of data ( in the order of a few 100 MBs) on the console. Using println for this is failing miserably on IntelliJ. Is there any alternative like console.log which can handle and display this data without lagging and slowing down?
Thanks in advance!
Console implements functions for displaying the stated values on the terminal i.e, with print, println, and printf we can post to the display. It is also utilized in reading values from the Console with the function from scala. io. StdIn. It is even helpful in constructing interactive programs.
Method # 1: Using the “println” Command The “println” command in the Scala programming language is used to print a line while introducing a new line at the end. In this way, if you want to print more than one line, each of them will be printed on a separate line.
You can buffer, and perhaps bypass character encoding. It's also worth looking at the IntelliJ settings, particularly if you don't see this problem when running from the commandline - perhaps IntelliJ is offering some functionality in its console (e.g. highlight errors, link stack traces to line numbers) that involves scanning every line. You might also worry about word wrapping in your console
(That said, I'm not sure how you expect to understand anything from 100MB of printing - if it's something you need to look at an overview of to "see the pattern", try making code see the pattern the same way you do)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With