8

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!

joanOfArc
  • 467
  • 1
  • 6
  • 16
  • 4
    Is the user expected to read all this? If not (as seems probable) write it to a file. I suspect the slowdown is IntelliJ - a test is run from the command line – mmmmmm Jan 20 '15 at 12:02
  • A user is supposed to read but I need to see. The content is basically avro of a huge size which I need to see for checking and analyzing certain things. It is a test. – joanOfArc Jan 20 '15 at 12:05
  • 1
    related - http://stackoverflow.com/questions/4437715/why-is-system-out-println-so-slow – dk14 Jan 20 '15 at 12:29
  • 1
    Are you calling println on a 100MB string? Or calling it in a loop? How have you identified that println is the issue? – The Archetypal Paul Jan 20 '15 at 13:39

1 Answers1

2

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)

Community
  • 1
  • 1
lmm
  • 17,386
  • 3
  • 26
  • 37