transmitting XML files vs. binary data

A

Aleksej

Hi All,

When two processes located at different nodes communicate with each other,
the interface of the communication can be implemented in two ways:

1) as a protocol; the data are defined as program structures and sent
finally as binaries.
2) as exchange of XML files; the data are defined in text files by means of
XML syntax and sent as strings.

How could you compare the performance of these two approaches?
I would go for XML files but I'm afraid that this can slow down the
communication. Is it so?

Thanks a million!

A.
 
M

Moonlit

Hi,

Sending over text files is of course a lot more overhead. However it is also
much easier to debug. It all really depends if you can afford the overhead.
- How fast is the network
- How much data

You could compress the data with the zlib library and extract it at the
other site (this is quite easy to do) and will usually greatly reduce
textfiles..
http://www.zlib.org

Regards, Ron AF Greve

http://moonlit.xs4all.nl
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

Aleksej said:
1) as a protocol; the data are defined as program structures and sent
finally as binaries.
2) as exchange of XML files; the data are defined in text files by means
of XML syntax and sent as strings.
How could you compare the performance of these two approaches?

What do you mean by "program structures sent as binaries" ? Send the data in
the native format for int, float... in the platform used?

And by a protocol? If you are referring to send over the net from program to
program instead of sendig files, you can use one method or the other
equally with binary data or with xml or any other text format. But you say
"sent as strings"... confusing.

In order to compare the performance, even in theory, you must clarify what
you intend to do in both cases. Or even better, program it and measure the
performance.
 
B

BigBrian

When two processes located at different nodes communicate with each other,
the interface of the communication can be implemented in two ways:

1) as a protocol; the data are defined as program structures and sent
finally as binaries.

"Protocol" doesn't necessarily imply binary data. TCP is a network
protocol, and you can use it to send text as well as binary data.
2) as exchange of XML files; the data are defined in text files by means of
XML syntax and sent as strings.

XML doesn't have to be the only text format.
How could you compare the performance of these two approaches?

uh, by taking measurements of quantities that are specified in your
requirements. How would you compare the performance? I'm guessing
that you don't plan to, and just plan on posting to inappropriate
newsgroups and asking people who have no idea what your requirements
are for their opinion.

-Brian
 
T

Thomas Matthews

Aleksej said:
Hi All,

When two processes located at different nodes communicate with each other,
the interface of the communication can be implemented in two ways:

1) as a protocol; the data are defined as program structures and sent
finally as binaries.
2) as exchange of XML files; the data are defined in text files by means of
XML syntax and sent as strings.
Why limit yourself to only two ways?
A defined protocol and ASCII are much more efficient than XML.
How could you compare the performance of these two approaches?
Implement simple processes that communicate with each other using
the protocols. Start a timer, run for over a million iterations.
Repeat with other protocols. Make sure to use lots of data in
the communications so you can get better quality of data.
I would go for XML files but I'm afraid that this can slow down the
communication. Is it so?
With XML, you are trading portability for efficiency. Binary formats
are very efficient, but not portable. Even when porting, issues
such as Endianism will slow it down.
Thanks a million!

A.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
M

Michal Nazarewicz

Aleksej said:
When two processes located at different nodes communicate with each other,
the interface of the communication can be implemented in two ways:
[cut: 1. binary protocol; 2. XML]
How could you compare the performance of these two approaches?

By benchmarking clients using each protocol...
I would go for XML files but I'm afraid that this can slow down the
communication. Is it so?

I would go for binary protocol unles you are going to transmit
floating point values as converting floating point variable to
platform independent binary reprezentation may be troublesam; or you
want to allow direct user interaction using telnet in which case
I would go for an ASCII protocol.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top