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 http://www.rgagnon.com/javadetails/java-0603.html 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 答疑

评论 抢沙发

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

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

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏