Performance Java Code