The option of writing the array onto string would be waste of time. As
it is u should not care about making write faster by making writes in
size of sectors as because of the buffer the file is already written in
sector size. "<<" opperator does not write on file but writes onto the
buffer only. Changes are reflected to file only when you close it.
Mayur wrote:
> If you're working with Linux - check out the mmap( ) system call.
>
> On 12/16/05, Uppala Babu <[EMAIL PROTECTED]> wrote:
> >
> > Adak is exactly right... use binary mode in writting to a file..
> > If you can write a big block will improve ur performance because it saves
> > lot of kernel mode / user mode switches..
> > but it depends on how (procedure) you use to convert your array to big
> > chunck of bytes...
> >
> > Do some profiling and let every body ...
> >
> > -Babu
> >
> > On 12/16/05, adak <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > With drive buffers as large as 16Megs., I expect the entire array to be
> > > written out as one block, in your option #1. Making the array into a
> > > single string in any case, would certainly take more time than it would
> > > save. Why not test both ways, one time?
> > >
> > > Opening the file in binary mode may improve your performance by 5 - 10%
> > > on some types of data, but that's all. It would be intersting for you
> > > to have your program time it both ways, and tell us the results. Hint,
> > > hint! <grin>
> > >
> > > If you have the option of getting a faster drive, (greater data
> > > throughput per second, and lower latency), that would be the biggest
> > > improvement.
> > >
> > > adak
> > >
> > >
> >

Reply via email to