www.sainivas.com1
Why performance is so important?Java2www.sainivas.com
Imagine a world where everything is UNLIMITED3www.sainivas.com
Sorry!!You are in a world where everything is LIMITED4www.sainivas.com
Why performance matters?90% of requirements are complex50% of apps share the same server10% increase in end users every dayPerformance should be planned initially and                  not inspected later.5www.sainivas.com
Great ways to improveJava PerformanceBy B. Sai Prasad6www.sainivas.comSimple
IntroductionJava PuzzlesShort programWhere is the issue?How to fix?What did you learn?7www.sainivas.com
Puzzle #18www.sainivas.com
Moral #1new operator creates a new object“new operator can be avoided by re-using byte arrays, or re-using objects”9www.sainivas.com
Puzzle #210www.sainivas.com
Moral #2Creating a Double from a string takes about 15 times than from a number“Use primitive data types for constructors rather than String objects.”11www.sainivas.com
Puzzle #312www.sainivas.com
Moral #3length() call in a tight loop can hit performance“String length is pre-computed, stored in a local variable and used it in a tight loop”13www.sainivas.com
Puzzle #414www.sainivas.com
Moral #4Default constructor is added automatically by compiler.“Generated constructor invokes the super class constructor.”15www.sainivas.com
Puzzle #516www.sainivas.com
Moral #5Minimize method calls by method inlining“Inlining is done by expanding the inlined method’s code in the code that calls the method”17www.sainivas.com
Puzzle #618www.sainivas.com
Moral #6System.arraycopy()efficiently copies one array to another“For very short arrays, use of this method may be counterproductive, because of overhead in actually calling the method”19www.sainivas.com
Puzzle #720www.sainivas.com
Moral #7BufferedReader reads characters in chunks“the read() method found in BufferedReader simply returns characters from a buffer”21www.sainivas.com
Puzzle #822www.sainivas.com
Moral #8Reuse. Reuse. Reuse.“It is better to reuse the java libraries than creating something new”23www.sainivas.com
Videowww.sainivas.com24

Great ways to improve java performance