System.out.print slow

I have an application that I made that prints out the bytes of a file to the system console. (cmd.exe, in my case) It is working very well, but I wanted it to go faster(for large files) so I optimized it. From my own testing, the part where it reads bytes from the file and stores them in a char array takes 15 to 32 milliseconds on a 250,000 byte file, but printing those chars to the command window takes over 9000 milliseconds!(9 seconds, almost 300 times slower!) I have tried but I did not see a significant improvement. Is there a way to print to the console faster or do I have to go with the JFrame/JTextArea strategy?
I/O in general is slow. What do you gain by printing out the bytes?

以上就是System.out.print slow的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准