Close input stream correctly
Add a little performance test main method