Condividi tramite


Managing Performance

Once you have a working multi-user application, you can use the following suggestions to improve performance:

  • Place temporary files on a local drive.
  • Choose between sorting and indexing files.
  • Schedule exclusive access to files.
  • Time the locking of files.

Place Temporary Files on a Local Drive

Visual FoxPro creates its temporary files in the Windows default Temp directory. Text editing sessions can also temporarily create a backup copy of the file being edited (a .bak file).

If local workstations have hard drives with plenty of free space, you can improve performance by placing these temporary work files on the local drive or in a RAM drive. Redirecting these files to a local drive or a RAM drive increases performance by reducing access to the network drive.

You can specify an alternate location for these files by including the EDITWORK, SORTWORK, PROGWORK and TMPFILES statements in your Config.fpw configuration file. For more information about managing files, see Optimizing Your System.

Choose between Sorting and Indexing Files

When the data contained in a table is relatively static, processing sorted tables sequentially without an order set improves performance. This doesn't mean that sorted tables cannot or should not take advantage of index files — the SEEK command, which requires an index, is incomparable for locating records quickly. However, once you locate a record with SEEK, you can turn ordering off.

Schedule Exclusive Access to Files

Commands that run when no other users require access to the data, such as overnight updates, can benefit by opening the data files for exclusive use. When files are open for exclusive use, performance improves because Visual FoxPro doesn't need to test the status of record or file locks.

Time the Locking of Files

To reduce contention between users for write access to a table or record, shorten the amount of time a record or table is locked. You can do this by locking the record only after it's edited rather than during editing. Optimistic row buffering gives you the shortest lock time.

For more information on improving performance, see Optimizing Your System. You can also find information on improving performance in your client/server applications in Optimizing Client/Server Performance.

See Also

Updating Data | Management of Updates with Views | Programming for Shared Access | Management of Conflicts | Buffering Data