Re: Binary v. Text, why is it faster?
- From: Duane Arnold <NotMe@xxxxxxxxx>
- Date: Tue, 07 Feb 2006 04:32:51 GMT
Arctic Fidelity wrote:
I have constantly seen and heard that reading binary data is faster than reading textual data. I have always presumed this to be a fact. But now I am at the point where I would like to understand why.
I was trying to think about it, and it has rather confused me. To my understanding, reading a text file is reading in the bytes which correspond to, for example, ASCII character codes. But if we are dealing with a 1-byte character encoding, how is it slower to read in 'a' rather than some binary representation of that?
It's not that. Binary data takes less bytes of data to represent the data as opposed to ASCII. An ASCII 7 takes 8 bytes to represent that number. The 7 in binary takes four bits 0111. The less bytes it takes to represent data will result in the faster sending, sending or accessing of the data.
And in addition to this, what is the actual difference between binary and textual files? I had always thought that a binary file was simply a file composed of any combination of bytes, whereas a text file was a file composed of a limited subset of the bytes available to a binary file. Am I misunderstanding something here?
A text file uses a character encoding scheme that displays the data that is readable by a Human Being. A file written in binary format contains information which is not displayable as characters. Software capable of understanding the particular binary format method of encoding information must be used to interpret the information in a binary formatted file. Binary formats are used to store more information in less space than in a character format file. They can also be searched and analyzed more quickly by the appropriate software.
I guess I just don't see how reading in AF would be slower just because AF appears in a text file instead of a "binary" file?
Where you would see the difference is in sending binary over a LAN as opposed to text over a LAN. Or binary over HTTP as opposed to SOAP/Text over HTTP. If you're concerned about speed over a network LAN or WAN, then one uses binary and not text.
Duane :)
.
- References:
- Binary v. Text, why is it faster?
- From: Arctic Fidelity
- Binary v. Text, why is it faster?
- Prev by Date: Re: Binary v. Text, why is it faster?
- Next by Date: Executable doesn't know location of data files
- Previous by thread: Re: Binary v. Text, why is it faster?
- Next by thread: Re: Binary v. Text, why is it faster?
- Index(es):
Relevant Pages
|
|