As one could imagine obtaining this information from a perforce database can take a lot of time, and put considerable strain on the database. The following performance measures have been taken.
The period between requests to the SCM can be throttled through the UI.
Typically operations are performed in chunks that are configurable. For example when the contents of files are needed groups of files are requested from the server instead of requested one by one.
One can imagine that one diff may take a long time, whereas the other diffs may not from a large changelist. To make things progress as fast as possible diffs are performed in a configurable number of threads.
To avoid inconsistent states of the database, after each insert into the database is completed, an undo sql statement is written to a log. If the application terminates abruptly, the partial changelist is reverted through this undo log.
Note: Using the MYSQL InnoDB database also provides a level of fault tolerance at the cost of speed.
Anonymous