JAXB vs XStream

Source: Internet
Author: User
Tags serialization xmlns oocl

These two things are essentially different, JAXB called the OX binding tool, XStream should be counted as a serialization tool, but the OX binding tool also Marshall and Unmarshall, so it contains the serialization part. The serialization tool does not necessarily need to provide binding functionality. Now that you're playing with serialization, simply compare the two of them in terms of serialization.

Jaxb:toplink JAXB 10133, which should be the JAXB 1.1 standard (canceling the validation function of the schema)

xstream:1.3.1

Data length:

length content
351 <com.oocl.frm.ws.sample.employee>

<name>liufei</name>

<age>40</age

<address>

<street>zhaojiabang</street>

<country>China< /country>

<city>shanghai</city>

<doornum>789</doornum>

& Lt;empname>afka liu</empname>

</address>

<salary>20000.0</salary>

<isactive>false</isactive>

<sexy>f</sexy>

</ Com.oocl.frm.ws.sample.employee>
589 (has removed white spaces) <?xml version= "1.0" encoding= "UTF-8"

<ns0:employee xsi: schemalocation= "HTTP://WWW.OOCL.COM/FRM/WS/JAXB" xmlns:xs= "Http://www.w3.org/2001/XMLSchema" xmlns:ns0= "http://" Www.oocl.com/frm/ws/jaxb "xmlns:xsi=" Http://www.w3.org/2001/XMLSchema-instance "><ns0:name>liufei</ Ns0:name><ns0:age>40</ns 0:age><ns0:salary>20000.0</ns0:salary><ns0:sexy>f< /ns0:se xy><ns0:isactive>false</ns0:isactive><ns0:address><ns0:st Reet>Zhaojiabang </ns0:street><ns0:country>China</ns0:country>;<ns0:city>shanghai</ns0:city>< ns0:doornum>789</ns0:doornum& Gt;<ns0:empname>afka liu</ns0:empname></ns0:address> </ns0:employee>

Time: Serialization and deserialization 1 million times.

Type Serialization (MS) Anti-serialization (MS)
Xstraem 90148 135878
TopLink JAXB 34872 56557

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.