3. Imagine a world where everything is UNLIMITED 3 www.sainivas.com
4. Sorry!!You are in a world where everything is LIMITED 4 www.sainivas.com
5. Why performance matters? 90% of requirements are complex 50% of apps share the same server 10% increase in end users every day Performance should be planned initially and not inspected later. 5 www.sainivas.com
6. Great ways to improveJava Performance By B. Sai Prasad 6 www.sainivas.com Simple
7. Introduction Java Puzzles Short program Where is the issue? How to fix? What did you learn? 7 www.sainivas.com
11. 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.” 11 www.sainivas.com
13. 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” 13 www.sainivas.com
17. Moral #5Minimize method calls by method inlining “Inlining is done by expanding the inlined method’s code in the code that calls the method” 17 www.sainivas.com
19. 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” 19 www.sainivas.com
21. Moral #7BufferedReader reads characters in chunks “the read() method found in BufferedReader simply returns characters from a buffer” 21 www.sainivas.com