Concrete Options @ Application Development

Qamer's View on Dev. Options

Posts Tagged ‘Application Tuning’

Quick check list for application’s performance tuning/optimization

Posted by Qamer Farooq on February 1, 2011

Writing an application is an easy task but its performance tuning and the optimization is a bit tricky job. To make it bit more simple I have listed few concrete options below:

  1. Do not take every thing as granted.
  2. Use buffering where possible specially in i/o operations.
  3. Use batches for bulk db operations.
  4. Avoid object creation in loops if possible.
  5. Synchronization should be minimized where possible.
  6. Put only non-avoidable data inside sessions, and remove them right after their usage.
  7. Choose the best fit XML parser, like if you have no need to load full document then DOM based parsers could be avoided.
  8. Remove unnecessary layers of your application, here you need good architectural skills to decide what should be removed.
  9. Remove unnecessary libraries and relevant code could be copied to your app if its really small. This could be helpful in avoiding PermGen errors.
  10. Make smart selection of collections. Like hashing based collections are the best candidate for implementing caching.
  11. Use of caches could improve the response time.
  12. Use standard implementation of caching instead of implementing your own, but of course it depends on your requirement. Like ORM mapping tools accompany standard caching options.
  13. Use of appropriate design patterns could also optimize your code, like uses decorator pattern to provide added functionality (like buffering etc.) on demand basis, instead of making every thing available either needed or not.
  14. Fetch what is required, instead of loading every thing relevant or irrelevant.
  15. Move db intensive operations into the database stored procedure, but it has a portability concerns which needs to be prioritize.
  16. Make use of paging when you are working with large data sets, this could also improve the response time.
  17. Joins using correct indexes could speed up performance.
  18. Set appropriate size of heap memory, like using a default heap memory size is non-sense for the application having hundreds of hibernate mapping files and lot of xml parsing functionality etc.
  19. Choose right application server based on your application requirements, if you can live with Tomcat then why WAS.
  20. Carefully set the size of connection pool, based on your application usage.
  21. Table Indexes should be added.
  22. De normalization could also be an option, but this needs to be decided carefully.
  23. This is not you who is always wrong, check your third party libraries if they are causing performance/memory issues, normally such issues are fixed in the new versions.

Posted in Performance / Optimization | Tagged: , , , | 4 Comments »