Re: Faster way to write in a file



On 13 fév, 15:13, Morris Dovey <mrdo...@xxxxxxxx> wrote:
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/eb329...

(mind the wrap)

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

Your idea is to use your "convert" function and to fwrite the
converted buffer ?
If yes, can I cast an long long in double to directly use it ?

Thanks !
.



Relevant Pages

  • Re: Faster way to write in a file
    ... If the textual representation is being done by fprintf, writing ... the unconverted data in binary form is _much_ faster - and, ...
    (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)