Re: Binary v. Text, why is it faster?



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 :)
.



Relevant Pages

  • Re: Binary v. Text, why is it faster?
    ... reading textual data. ... To my understanding, reading a text file is reading in the bytes which correspond to, for example, ASCII character codes. ... Also some editors will helpfully display an unaccompanied 0x0a as ^M which is really helpful, thanks guys, really makes things a lot more readable, as if you didn't understand what had happened here. ...
    (comp.programming)
  • Re: asymptote/hyperbola?
    ... He's presenting a character who's talking math. ... So a responsible reading will account for this nonsense in at least one ... Translation is the foundation of every reading. ... >> On your last hermeneutic occasion, you informed us that all the dancer ...
    (rec.arts.books)
  • Re: Update
    ... So my writing isn't making the jumps it could, ... otherwise not particularly good series --the lead character nearly ... The possible interruption was someone betareading one of my books, ... I liked reading the story. ...
    (rec.arts.sf.composition)
  • Recently Read - February, 2006
    ... It's been a busy month with reading taking last place. ... almost as well as Robin McKinley on a so-so day. ... Good vs. Evil breaks out. ... Lt. Eve Dallas is after a cool character this time. ...
    (rec.arts.sf.written)
  • Re: Watchmen?
    ... I'd like to point out that the presence of Kovacs' psychiatrist moved ... Now that I've read (am reading) that thread, ... Usually I get Pinter rather than Joyce. ... character gave a monologue, another character appeared, and they ...
    (rec.arts.comics.dc.universe)