Re: Faster way to write in a file



Mark Bluemel wrote:

How does dumping the data in binary form compare to writing a
tab-delimited textual representation?

If the textual representation is being done by fprintf(), writing
the unconverted data in binary form is _much_ faster - and, of
course, may produce problems if there's a subsequent need to read
the data on a different machine.

A special-purpose double -> text conversion routine can provide a
fair amount of speed improvement. A real-world example was
developed in this CLC thread:

http://groups.google.com/group/comp.lang.c/browse_thread/thread/eb3297730a3cc476/995f74496633fe3a?lnk=st&q=#995f74496633fe3a

(mind the wrap)

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
.



Relevant Pages

  • Re: Faster way to write in a file
    ... If the textual representation is being done by fprintf, ... the unconverted data in binary form is _much_ faster - and, ... A special-purpose double -> text conversion routine can provide a ...
    (comp.lang.c)
  • Re: Faster way to write in a file
    ... If the textual representation is being done by fprintf, ... DeSoto, Iowa USAhttp://www.iedu.com/DeSoto ... wanting (long long -> string). ...
    (comp.lang.c)
  • Re: Faster way to write in a file
    ... the unconverted data in binary form is _much_ faster - and, ... may produce problems if there's a subsequent need to read ...
    (comp.lang.c)