Friday, 30 May 2014

Do away with System.out.println and Logger.info and your code now runs really faster!

I wrote a 10-threaded script last evening and was astounded to note that the performance hadn't really improved as I had expected. I knew for sure that I had parallelized all computation to get that 10x boost in speed from my initial single-threaded code and I was struck by this weird idea that 'sysout' and Logger.info were to blame. 

My good friend told me that if I were printing feedback out to the console on every single operation, that was a good reason why my code didn't perform as had been anticipated initially. I removed all those statements and bang! the code now run smooth and fast. 


No comments:

Post a Comment