Slow Disk Access in LVRT in Large Directories Primary Software: LabVIEW Modules>>Real-Time ModulePrimary Software Version: 7.0 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: Image Acquisition (IMAQ)>>Compact Vision System
Problem: My LabVIEW Real-Time application reads and writes to large directories on a hard disk. As the number of files in a given directory increases, the time required to perform disk access becomes very long. Why? Solution: LVRT uses the FAT file system, which has inherent limitations. In FAT, each directory is an unsorted list of entries (files). The average time required to find an entry in an unsorted list, statistically, will increase with the total number of entries in that list. Statistically, if there are ten files in a directory, the system will need to examine an average of five entries to find the desired one. If that list grows to 1000 entries, the average number examined for each access also grows to 500. This problem is illuminated when considering how the files are stored on the disk physically. Because there are only sixteen directory entries per sector on the disk, examining 500 directory entires leads to reading in over thirty disk sectors, plus referring to the File Allocation Table to determine where those sectors are located. This intense disk access causes the delays. These problems are not local to NI hardware or LVRT. They exist in any operating system that uses FAT. (This is one of the reasons NTFS is recommended over FAT during a Windows installation.) Because LVRT was designed with FAT at its core, no simple "fix" can be provided. Workaround Write no more than 16 files to each directory. This will prevent multiple accesses of the file allocation table and will limit read operations to a single sector. Related Links: Attachments:
Report Date: 06/01/2006 Last Updated: 06/12/2006 Document ID: 3Y0CTKD3 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
