Using fread() and fwrite(), file access is much slower than anticipated/desired.
Unless you are using small read/write sizes, e.g. less than 100 bytes, you may find that using read()/write() improves performance over fread()/fwrite(). Alternatively, increasing the buffer size using setvbuf() may help. In one particular situation, changing fwrite() to write() yielded 4x greater file write speed.
Also, larger block sizes can increase performance, albeit with the consequence of less efficient disk space usage for smaller files. If you are using the QNX 6 filesystem, the block size can be changed during initialization by mkqnx6fs with the -b option. In one particular case, increasing from the the default of 1024 to 4096 caused a 25% increase in write speed.
NOTE:
This entry has been validated against the SDP version listed above. Use
caution when considering this advice for any other SDP version. For
supported releases, please reach out to QNX Technical Support if you have any questions/concerns.