2008-09-20 00:07
one, review
This paper compares the RMI, Hessian, Burlap, Httpinvoker, web service protocols such as 5 in a different amount of data structures and different data when the transmission performance.
RMI is the java language itself provides remote communication protocol, stable and efficient, is the basis of EJB. But it can only be used for communication between the JAVA program.
Hessian and Burlap is caucho open source license provided, based on HTTP transfer, the server do not have to open firewall ports. Standard and open protocol that can be used in any language.
Httpinvoker is SpringFramework provide remote communication protocol, can only be used for communication between JAVA program , and the server and the client must use SpringFramework.
Web service is to connect heterogeneous systems or heterogeneous language preferred protocol, which uses the SOAP form of communication, can be used in any language,
air max 2009, its current support for many development tools is also very good.
test results show the efficiency of several communication protocols were:
RMI> Httpinvoker> = Hessian>> Burlap>> web service
RMI is indeed the first choice for JAVA remote call protocol, is very efficient and stable, especially in the case of a large amount of data, the gap with other communication protocols is particularly obvious.
HttpInvoker serialization using java technology transfer objects, and RMI is essentially the same. From an efficiency point of view, both are almost the same, HttpInvoker with RMI's basically the same transmission time.
Hessian small object in the transmission,
nike air max 2009 sale, but also quickly and efficiently than the RMI, but the transmission of data object or a large number of complex data objects, RMI is slower than about 20%.
Burlap only a data transmission speed can still, usually, when it mg 3 times RMI. inefficiencies
Web Service is well known that, on average, Web Service communication cents to 10 times when RMI.
Second, the results of
1, direct calls to direct calls to
when all are close to 0 cents, which shows almost no procedures take time, record all the time are remote calls consuming.
2, RMI
with the vision of the call, RMI of course is the fastest in almost all cases,
nike air max shoes, when it is the least cents. Especially in complex data structure, the case of large volumes of data, and especially the gap between other protocols.
order to give full play to the performance of RMI, also made a test class, do not use Spring, RMI with the original form (inherited UnicastRemoteObject object) to provide services and remote calls to the POJO with Spring RMI for efficient packaging into the comparison. The results showed: two flat, Spring provides the service also slightly faster.
preliminary view is that this is because Spring's proxy and caching mechanism is relatively strong, save the object again to get the time.
3, Hessian call
caucho resin server company claims is the fastest server in the java field have a certain visibility. Hessian resin as part of its design is very streamlined and efficient, the actual operation also proved this point. On average, Hessian slower than about 20% of RMI, but only in particularly large amount of data,
nike air max, the data structure is very complicated cases can be reflected, medium, or small amount of data , Hessian is not slower than RMI.
Hessian has the advantage of streamlined and efficient, you can cross-language use, and protocol specification public, we can develop in any language for the implementation of their agreement. At present, implementation of the language: java,
air max sale, c + +,. Net, python, ruby. No delphi implementation.
addition, Hessian and the WEB server with very good, with the maturity of WEB server function, in dealing with concurrent access to a large number of users there will be a great advantage in resource allocation, thread queues, and other aspects of exception handling can be a mature WEB server guarantees. The RMI does not provide multi-threaded server. Moreover, RMI need to open firewall ports, Hessian not.
4, Burlap and Hessian are called
Burlap caucho's open source products, but Hessian binary way, and Burlap with xml format.
test results show that, Burlap in the data structure is not complicated, the case of the data medium, the efficiency is still acceptable, but if the amount of data, the efficiency would drop dramatically. On average, Burlap cents a call 3 times when RMI.
I think, its low efficiency, there are two reasons, one is the XML data description is too big, the same data structure, its throughput is much larger; On the other hand, is well known that xml parsing is more cost resources, in particular the case for the especially large amounts of data .
5, HttpInvoker SpringFramework call
HttpInvoker is provided by the JAVA remote method call, use the java object serialization mechanism to handle the transmission. From the test results, its efficiency is still possible, with the RMI flat.
However, it can only be used for communication between the JAVA language, and that requires the client and server are using the SPRING framework.
addition, HttpInvoker did not undergo the test of practice, has yet to find application of the agreements.
6, web service call
The test selected apache in the AXIS component as the realization of WEB SERVICE, AXIS WEB SERVICE field in the relatively mature veteran.
order to test the data transfer and only the encoding and decoding time, the client and server are using the cache, the object is instantiated only once. However, the test results show, web service efficiency or other communication protocols than 10 times slower.
If we consider the same object multiple references to the transmission case, web service to lag behind more. As RMI, Hessian and other protocols can be passed a reference to the number of web service reference, how many objects should copy the entities.
Web service is the transmission of redundant information over one of the reasons of its slow, monitoring found that the same request for a visit, describing the same data, web service returns the data volume is 6.5 times the hessian protocol. In addition, WEB SERVICE processing is also very cents, the current efficiency is generally low xml parser to handle xml bean is cents resources. From the test results, remote calls faster than local calls,
nike air max sale, but also shows its cents from the side when used in the encoding and decoding the main xml file . This is more serious than redundant information, redundant information network bandwidth is occupied, and each call takes a direct impact on the resource to the server load capacity. (MS engineers have said, with WEB SERVICE can not load more than 100 concurrent users. )
Found during testing, web service code not convenient, non-basic types of needs one by one up for serialization and deserialization class, very troublesome, generate stub more tired, as spring + RMI / hessian address so simple and fluent. Moreover, web service does not support the set type, can only use arrays, not convenient