Performance is key factor in any application development.Especially, while building distributed enterprise applications perfomance is a key measure which we need to take in to account.Overall performance of web service application depends on how fast a service can respond to the requestor.The whole cycle includes time required for processing,binding and responding back to the request.
Processing involves XML binding and processing which has a significant role in overall performance of web services.The performance can be analyzed from the perspectives of service consumer,service producer and the service process.
Performance of web services can be measured based on three factors :
1)How fast was the execution ?
2) How much time did it take to complete the requested task
3) The time taken for the processing under increased traffic .
These can be measured by measuring Response Time, Throughput and Transaction time
It is the time taken for initiation of request by client ,processing which involves SOAP message marshalling and un-marshalling and to perform business task at end point
To measure the response time we need to measure end to end performance and also end point performance
Endpoint performance ; It is nothing but server side performannce
End -to End performance :This includes both the server and client performance
Amount of data processed by end point
Throughput =Total requests*SOAP response message size (Average)/Time Period
Time taken to execute business task at end point
Performance of Web services depends on the following :
From above ,we can make few things clear that performance of web services depends up on network,underlying hardware ,binding performance,processing performance.
Processing involves marshalling and un marshalling which is nothing but serialization and de-serialization which can be improved while developing applications.
Here are some points concentrated on how can we improve from application point of view which improves binding performance,processing performance.
1)Using primitives appropriately :
This will improve the performance of web services because specifying decimal points increases the serialization and de-serialization which effects performance.It is best to use the xsd:decimal/BigDecimal type to avoid rounding off decimal values for all monetary calculations
2)Binding performance :
Compared to DOM , JAXB has improved binding performance.JAXB has mapping for Java types to and from XML definitions.JAXB provides better binding performance than DOM or any other non-schema binding model. As a result of this at larger payloads the performance of JAX WS is twice than JAX RPC.
The more payload you send, the more processing is required for the serialization and de-serialization, as well as for binding and parsing.
This has a considerable effect on performance.
4)Using MTOM for tansmitting binary data
If the SOAP message body includes large binary objects more than 1MB then it takes more time to parse which consumes more time and also CPU for parsing it.
Enabling Message Transmission optimization Mechanism (MTOM) for larger chunks of data improves processing performance of web services.