Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Speed up fprintf or fwrite

$
0
0

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!


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>