Archive

Archive for the ‘Performance Issues’ Category

Performance Optimization Java J2EE Aplications

January 30, 2008 1 comment

One can optimize the performance of Java J2EE Application by considering some of the design level, system level, application level changes.

- Design level factors by following effective design patterns for a problem

- Application level considering by looking into app server tuning, coding details etc.

 -identify the potential issues like memory leakage, security issues, transactional issues, extendability, maintainability issues

Hibernate

Hibernate – It is written in java, an open source project, provides ORM (Object Relational Mapping) solution, technology for persisting data in any kind of application. Powerful object-oriented persistence, hibernate query language, the object oriented concept is similar to java for association, inheritance, polymorphism, composition and collection. It has automatic primary key generation, perists the java objects into database table format using the metadata that defines the object & database mapping.  ORM tools address the CRUD operations on the objects of persistent classes. Web applications due to database traffic will have performance issues. Caching is the best technique to solve the heavy traffic performance problem.

One can achieve lazy loading in hibernate – loads parent objects first and later the child objects, an ORM technique.

Advantages:

- High performance

- Object Relational Mapping ORM solution is better

- Object-Oriented Query language

- One can avoid rewriting queries

- Easy Maintenance and ease to developer to concentrate on business logic rather than maintenance functionality.

Disadvantages:

- Lacks performance related to connection management and transactonal management

Hibernate xml mapping document defines the properties, mapping details

Hibernate XML Mapping Document Example:

Hibernate XML Mapping Document Example

Hibernate Architecture:

The below diagram shows Hibernate using the database and configuration data to provide persistence services /objects to the application.

Hibernate Architecture

There are couple of hibernate plugins (open source available) for Eclipse, Visual Studio etc. 

AJAX Performance Design issues

Asynchronous Javascript + XML = AJAX – It is Client Server Technology, The web page is refreshed without reloading the entire page, it is the user interface with javascript. One needs expertise in html, css, javascript, DOM, asynchronous data exchange. The client in this case needs to connect to web server to facilitate the communication and data transfer.

Ajax limitations

*It is a bit slow

*End user experience is effected by the round trip behavior  as it is slower 

*if  not designed well it will affect the performance.

ajax widgets to your site using ajax tags which supports multiple browsers, rich library of ajax components, they are lot of free community edition – ajax widgets , navigational widgets, form, data widgets available on net.

Multi threading – performance

Multi threading – synchronization, sharing of resources multi threads access, multiple threads running in a system. One of the thread can modify shared variable while another thread is in the process of updating same shared variable. inheriting from Thread class, runnable interface. Handle multiple clients at the same time. The methods that are used for inter thread communication are wait(), notify() and notifyall(). When a thread terminates its processing, it enters the dead state. A lock can be acquired on a class.
The OS (operating systems) systems task scheduled allocates execution time to multiple tasks.

Synchronized can be defined at Method level or for a block as the statements within {}

Performance concerns of I/O- Threads block on i/o – it enters the waiting state, meanwhile the other threads may execute while the i/o Operation is performed. Changing the multi-threading level improves performances and reliability.

Follow

Get every new post delivered to your Inbox.