Prashant Deva's blog

Talks on technology and the latest developments in Placid Systems.

Wonder why your Java IO is slow?

Saturday, January 20, 2007

During one of my debugging sessions, I came across the following piece of code inside the java.io.PrintStream class from jdk 5.

protected void setError() {
trouble = true;

try { throw new IOException();} catch (IOException x) {}


No wonder java IO is so slow!

Labels: , ,

posted by Prashant Deva, 2:19 AM


I had to open the source just to look. At least its only in the setError method so, its not being called in a loop.

That has gone in Java 6.

commented by Anonymous, 8:01 PM, January 23, 2007  

Add a comment