473,413 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

transmitting XML files vs. binary data

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.
Sep 7 '06 #1
5 2233
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

"Aleksej" <qn*@mail.ruwrote in message
news:ed************@hades.rz.uni-saarland.de...
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.

Sep 7 '06 #2
Aleksej wrote:
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.

--
Salu2
Sep 7 '06 #3
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

Sep 8 '06 #4
Aleksej wrote:
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

Sep 9 '06 #5
"Aleksej" <qn*@mail.ruwrites:
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.

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
Sep 10 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: gudia | last post by:
I am using CDO to email a file as an attachment. The receiver receives the file, but when he opens the file (tried using both Acrobat Reader 6 and 5), he gets "There was an error opening this...
28
by: wwj | last post by:
void main() { char* p="Hello"; printf("%s",p); *p='w'; printf("%s",p); }
6
by: alice | last post by:
hi all, Can anybody please tell the advantages which the binary files offers over the character files. Thanks, Alice walls
4
by: knapak | last post by:
Hello I'm a self instructed amateur attempting to read a huge file from disk... so bear with me please... I just learned that reading a file in binary is faster than text. So I wrote the...
1
by: Al | last post by:
Searching for a way to upload binary files from client to server, I came across the following link: http://www.dotnetextreme.com/code/BinaryUpload.asp With this precaution: Editor's note -...
15
by: JoeC | last post by:
I am writing a program that I am trying to learn and save binary files. This is the page I found as a source: http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html I have...
18
jhardman
by: jhardman | last post by:
Have you ever wanted to upload files through a form and thought, "I'd really like to use ASP, it surely has that capability, but the tutorial I used to learn ASP didn't mention how to do this."? ...
2
by: Draggonn | last post by:
Hello all. I'm not sure if this is the right part of the forum to ask, but I couldn't find any better place. I am trying to make a program that will take a file of any extension, and split it into...
26
by: Bill Cunningham | last post by:
I have written this short program to empty out files. It works great except that it truncates. My guess was that it was in the fopen mode somewhere but I have played with that and the same results....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.