Improve File Access Performance (Compact 2013)

3/26/2014

This topic provides strategies that you can use to help improve file access performance.

Enable File Caching

File compression requires the OS to decompress the file before using it, which takes time and affects performance. You can reduce the impact on performance by enabling file caching, which causes the OS to decompress the file only once and then keeps the content in RAM.

For more information about enabling file caching, see Registry Settings for File Caching.

Enable BinFS

You can use the binary ROM Image File System (BinFS) to directly access executable files.

For more information about BinFS, see Binary ROM Iimage File System (BinFS) and How to Implement BinFS on MSDN.

For information about enabling BinFS, see BinFS Registry Settings.

Improve Disk Performance

One way to improve file access performance is to improve disk performance. There are two primary causes for poor disk performance:

  • Disk Fragmentation. When using a disk-based file system, disk fragmentation can cause critical performance issues. Large partition or small cluster sizes with significant fragmentation can cause the system to perform multiple scans on the disk for free sectors to write even small files.
  • Low Disk Space. On ExFAT and TexFAT file systems, when the amount of free disk space is low on a Windows Embedded Compact powered device, disk reads and writes may take much longer than expected. As with disk fragmentation, low amounts of free space (less than 10 percent of the available disk space) can cause the system to take a long time to find free clusters to write to.

You can address these issues by using the following solutions:

  • Increase the cluster size.
  • Decrease the partition size.
  • Avoid small file writes and deletes.

Important

All of these solutions may require you to make trade-offs between performance and efficient use of space.

Increase the Cluster Size

Increasing the size of clusters reduces the number of clusters that FatEx::GetFreeClusters must search through to find free clusters. However, increasing the cluster size also increases the amount of space wasted by small files. For more information, see FormatVolume or FormatVolumeEx.

Decrease the Partition Size

Decreasing the size of the partition also reduces the number of clusters searched. However, breaking a disk up into multiple partitions can result in running out of space for files more quickly if the partition sizes are not managed carefully. For more information, see PD_CreatePartition.

Avoid Small File Writes and Deletes

Saving a large number of files that are smaller than the cluster size wastes space on the disk because each file occupies at least one full cluster. If possible, use one larger file instead of multiple smaller files, but only when it makes sense to concatenate multiple types of information into the same file.

See Also

Concepts

Optimize Runtime Performance