This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Speed up fprintf or fwrite

Other Parts Discussed in Thread: OMAP-L137

I'm developing on OMAP-L137

I have short_array[80000].  Have to export short_array to file and check in excel.

So, I use fprintf to write short_array to file.

But the write speed is very slow  (22 seconds, write 10000 rows)

i tried several way to speed up.   

Method A:  setvbuf to set large buffer

setvbuf ( pFile , buf, _IOFBF , sizeof(buf) );

Method B; fwrite with large buffer

fwrite( buf, 1, strlen( buf ), pFile );

The above two methods can't speed up writing file.

Please advise other ways.   Thanks a lot!