Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

Suggestions for improving disk access speeds
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: Suggestions for improving disk access speeds
  • SDP: 6.3.2, 6.4.0, 6.4.1, 6.5.0
  • Target: Any supported target
________________________________________________________________________

Solution
________________________________________________________________________

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.
________________________________________________________________________


Related Attachments
 None Found





Please contact us with your questions or concerns.