June 29, 2015

Making p4 status and p4 reconcile Better and Faster

In the 2015.1 Perforce Helix release, engineering improved the performance of two distributed version control system (DVCS) commands: p4 status and p4 reconcile (aka p4 rec). The p4 reconcile and p4 status commands were first introduced in the 2012.1 release of Helix. These commands do a recursive scan of your local workspace files, comparing the Md5 checksum of the actual files in your workspace to the checksum stored in the p4d server. Using the results of this scan, p4 decides if files have been added, modified or deleted in the workspace, and marks them for add, edit, or delete as appropriate. It will also figure out if you’ve moved files, even if you’ve made small changes as can happened with refactored Java files.

Those of you working offline or disconnected from the Helix server are most likely familiar with these commands. What you might not know is that we have improved their performance. 
The essence of the change is to use the file timestamp, rather than the file digest, to decide if the file has changed. Checking the file's timestamp is much faster than re-computing the file's digest, especially for very large files. Other minor changes involved network protocol updates.  Boom - you now have faster performance for these commands!
While working in your personal server you automatically reap the performance benefit when running p4 status and p4 rec. When working with a personal server you don’t even have to set modtime in your client - we can use the sync time just as easily. When working in a centralized fashion against a shared server you can simply run p4 status –m or p4 rec –m to gain these performance benefits, as long as you have set modtime in your client. Take it for a spin and enjoy the extra speed!