# Disk I/O

Reading and writing to disk can lead to varied performance times for a Task. Due to not necessarily knowing what else is using a PC's hard drive, disk I/O can delay a process if Designer needs to wait to access a file (for example, if Windows is indexing the files on the same physical disk where Designer stores its project files).

Cognex recommends the following disk I/O strategies:

- Perform disk I/O asynchronously.
- Use a SQL Server with a Database, especially when performance is a major factor in your application.
- Perform disk read/writes on a separate physical drive than the drive being used by the OS; simply splitting a drive to have C and D partitions is of no benefit, and can actually decrease performance.
- Use a solid-state drive (SSD) if disk I/O is having a negative impact on performance.

In addition, the following actions while the project is deployed may cause problems with disk I/O performance:

- Loading an image from a disk on the same main processing Task.
- Saving images synchronously in a Task.
- Writing to the default database (SQLite) in safe/slow mode on the same main processing Task.

Finally, there are also some issues that may arise, outside the scope of your application, which may also cause disk I/O performance problems:

- The OS is constantly reading/writing system files in the background; trying to read and write at the same time will result in a performance hit.
- Anti-Virus programs tend to scan items being written to disk.

- The Windows Disk Defragmenter program operating in the background.

  Note: On Windows 7, the Disk Defragmenter program performs disk defragmentation in the background, which can have a negative effect on performance. In a production environment, it might be worthwhile to either disable it or configure a schedule that does not impact the deployed application.