JAXWS 2.0.1 Performance Improvements

JAX-WS 2.0 shipped as an FCS version before JavaOne (2006/05/09). JAXWS 2.0.1 is a overhaul of JAXWS 2.0 RI for improved performance and better pluggability to allow other technologies like WSIT to be layered on top. It still conforms to the same JSR spec. The team has spent a lot of cycles trying to optimize JAX-WS performance and the results can be seen in the graph below.
Between JAX-RPC and JAX-WS 2.0.1 (ie the rearchitected implementation), performance has impoved between approximately 70% depending on the test cases.
The graph below shows a comparison of JAX-RPC vs JAXWS 2.0 and JAXWS 2.0 vs JAXWS 2.0.1









JAXRPC vs JAX-WS 2.0


JAXWS 2.0 vs JAX-WS 2.0.1


JAX-RPC 1.1 vs JAX-WS 2.0.1



JAX-WS 2.0 was a rewrite from ground up of JAX-RPC and included a lot of new features (like integration with JAXB 2.0) which contributed to a slight regression in performance. Performance has been at the center of the implementation rearchitecture.Some enhancements include


  • Revisiting some of the key abstractions

    • For example. avioded using StAX and going straight from JAXB to OutputStream. This reduces the number of layers and avoids the escaping, character encoding and namespace management done by StAX.

    • Better handling of properties Prior to JAXWS 2.0.1 a HashMap was used to hold properties that were all pre-evaluated and in fact read more often than written.In JAX-WS 2.0.1 a distributed property set with lazy evaluation is used.



  • Collapsing the stack where ever possible

    • For example, initially a byte image of the whole message was kept around and a DOM built for the whole message to access headers. This inadvertently led to XML being parsed twice.

      To avoid this JAXWS 2.0.1 uses a stream buffer which records infoset to necklace-like data structure and allows it to be replayed later. It's not randomly accessible though.

      It supports various XML API's. Eg reads via XMLStreamReader and writes via XMLStreamWriter; or fire SAX events to ContentHandler.



  • Reducing the number of special purpose interfaces.

    • For example no more custom hooks for JavaEE

    • Better handling of endpointaddress property. In JAXWS 2.0 implementation this was stored in a string and then converted to a new URL() everytime. In the 2.0.1 implmentation its stored as a URL in the distributed property set and a URI is created for storing proxy information which is used by the JDK's URL.openStream()





Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

sameert

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today