Poor performance of Java2D