Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Methods for fast binary file output?

Reply
Thread Tools

Methods for fast binary file output?

 
 
email.ttindustries@gmail.com
Guest
Posts: n/a
 
      07-19-2007
Hello,

I am a C/C++ newbie and I have a simple question concerning fast data
writing to binary files. Are there any other faster methods than the
standard write() method to write to binary data files? I ask this
question because I have to store a big amount of data coming from an
PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
implement some additional computations and would need to speed up the
data transfer. I am using a Windows XP computer and GCC 3.4.3 and
Borland 5.5 respectively. Are there any special free libraries for
this purpose?

Thank you very much

Daniel

 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      07-19-2007
wrote:
> Hello,
>
> I am a C/C++ newbie and I have a simple question concerning fast data
> writing to binary files. Are there any other faster methods than the
> standard write() method to write to binary data files?


Possibly, but standard C++ does not specify the speed of any operation.
Gnerally speaking the closer you get to the underlying operating system
the faster things will be. But none of that is standard C++, it's
platform specific.

I ask this
> question because I have to store a big amount of data coming from an
> PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
> implement some additional computations and would need to speed up the
> data transfer. I am using a Windows XP computer and GCC 3.4.3 and
> Borland 5.5 respectively. Are there any special free libraries for
> this purpose?


Everything you ask depends upon the C++ you are using, and the operating
system you are using, maybe even the machine you are using. The answers
to your questions will depend very much on your particular circumstances.

If I were you I would try all the different methods you can find and
time them. That way you can answer your own questions. As to any special
purpose libraries, I doubt it, but the place to ask is a g++ group or a
Borland group.

>
> Thank you very much
>
> Daniel
>


john
 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      07-19-2007
<> wrote in message
news: ps.com...
> Hello,
>
> I am a C/C++ newbie and I have a simple question concerning fast data
> writing to binary files. Are there any other faster methods than the
> standard write() method to write to binary data files? I ask this
> question because I have to store a big amount of data coming from an
> PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
> implement some additional computations and would need to speed up the
> data transfer. I am using a Windows XP computer and GCC 3.4.3 and
> Borland 5.5 respectively. Are there any special free libraries for
> this purpose?
>
> Thank you very much


Well, the delay will come in to the physcial read and writes with moving the
heads, etc... If you buffer the writes then you shouldnt' get that delay.
This will especially work if you can load the entire data to write in
memory, although it doesn't sound like you can do that with 20MB/second.

Another alternative is to use threads. Send a write request to a thread
safe que that another thread reads to write the data, then your main thread
shouldn't have to wait for the file i/o to complete. This will probably work
as long as the writing thread can keep up with writing 20MB/second. I
really don't know how fast HDs are nowadays with MB/second but 20 should be
fine.

You might want to discuss this in comp.programming.threads


 
Reply With Quote
 
Just me
Guest
Posts: n/a
 
      07-23-2007
On Thu, 19 Jul 2007 07:45:29 -0700, email.ttindustries wrote:

> Hello,
>
> I am a C/C++ newbie and I have a simple question concerning fast data
> writing to binary files. Are there any other faster methods than the
> standard write() method to write to binary data files? I ask this
> question because I have to store a big amount of data coming from an PCI
> A/D card with a sampling frequency of 20 MB/s. Now I have to implement
> some additional computations and would need to speed up the data
> transfer. I am using a Windows XP computer and GCC 3.4.3 and Borland 5.5
> respectively. Are there any special free libraries for this purpose?


Do you REALLY need to sample at 20MB/s? Can you lower the sampling rate
to something realistic and still get adequate samples? That would be my
first question.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
Methods for fast binary file output? email.ttindustries@gmail.com C Programming 3 07-21-2007 03:10 AM
More memory: How fast is fast rfdjr1@optonline.net Computer Support 5 05-19-2004 05:45 PM
I NEED HELP FAST!!!!! REAL FAST!!!!! R. Jizzle MCSE 3 09-29-2003 08:51 PM
Super-fast AA Chargers: Anything as fast as the 15 minute Rayovac? David Chien Digital Photography 4 08-30-2003 07:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57