Friday, June 14, 2013

Comparison of Git and Perforce


Hello All,

I recently had to do a comparison of  Git and Perforce at work and thought I'd share the most important points I used in arguing that Git was the best SCM tool for us to adopt.  As usual, the names have been changed to protect the guilty.

Enjoy!
Alan Thompson




Notes and Comparisons of Git and Perforce for
Software Configuration Management
At DynoSoft

  • Git Features and Notes:
    • Git is a state-of-the-art SCM system that meets all of our needs
      • Originally created for the Linux kernel in 2005
      • Widely used by millions of developers all over the world
    • Git operates on any computer (PC, Unix, Mac)
      • Pervasively available everywhere
      • Does not require a dedicated administrator
      • Does not require annual license fees
      • Does not require a dedicated server
    • Fast & efficient network operations (compressed delta changesets)
      • Especially important for remote users
    • Fast & flexible for software developers
      • No rigid checkin/checkout procedures
      • No centralized administrator bottleneck
      • Easy to share code between desktop, laptop, dynoServer, etc
    • Each user has a local snapshot of the codebase
      • fast & efficient coding & testing
      • Multiple, redundant backups mitigate against hardware failures
    • Highly efficient, internally compressed storage
      • Archive of 18 DynoTool releases (since 2006) consumes only $0.10 worth of disk space (4.5 million LOC each)
    • Widely used by students and prospective employees
      • Used in college, other companies, open-source projects
      • The popular Github site has surpassed over 6 million hosted repositories (see http://goo.gl/S6iss )
    • Git is already installed and running at DynoSoft
      • Available to every developer, today

  • Gerrit Features and Notes:
    • Gerrit is a state-of-the-art code review/collaboration system that meets all of our needs.
      • Integrates closely with git
    • Created by Google to automate developer code review, collaboration & testing.
      • Used by Google for Android community software development
      • Maintains both an authoritative code repository and a separate list of pending code submissions
    • Web-based interface for reviewing, discussing & approving code submissions
      • Developers receive email notifications of updates/changes
      • Developers may work asynchronously
      • Developers may be geographically dispersed
    • Persistent data store of all submissions, comments, tests, and merges
    • Team members can be assigned different permissions and roles
    • Code submissions trigger automated build, unit test, and code quality checks
      • Jenkins CI server is already used at DynoSoft
    • Gerrit/Jenkins is already installed and running at DynoSoft
      • available to every developer, today
      • see http://server:8080 - Gerrit demo server
      • see http://server:8081 - Jenkins demo server

  • Perforce Features and Notes:
    • Perforce is a longstanding, proprietary SCM system
    • Requires commercial license fees (recurring cost)
      • 100-500 licenses needed by DynoSoft (all of PD, QA, Conversion, others?)
    • Requires powerful, dedicated hardware (e.g. expensive) for central server
      • Recurring cost for maintenance, upgrade, and expansion
    • Often requires a dedicated administrator position
      • Recurring cost for salary & benefits
    • Network transmissions required for every Perforce operation
      • Especially slow for remote users
    • Central server is a processing bottleneck for every user operation
      • All users must share same central server
    • Central administrator is a bottleneck for user/developer requests
      • Users must wait until administrator is available
    • Rigid checkin/checkout procedures and project layouts are a daily, continuous drag on developer productivity
    • Old-style patch-set storage mechanism (file deltas) is inefficient for branching, merging, & file diff operations
    • Central server is a single-point-of-failure
      • May need a backup hot-swappable server to mitigate risk

Git vs. Perforce comparison:
Imagine you must get from DynoSoft in San Diego to a business meeting in Carlsbad (30 miles). Your options are to walk, ride a bicycle, drive your own car, or use the train. Let's explore these options:
  1. Walk
    1. The simplest and most direct method.
    2. Requires no outside resources.
    3. Requires 10 hours at 3 mph even without breaks.
    4. Very slow, tiring, and an inefficient use of time.
    5. This is the equivalent of using no SCM system at all, where users simply copy or email files in an ad hoc manner.
    6. Out-of-pocket cost is essentially zero.
    7. Productivity cost (at $50/hr) is $500.

  1. Bicycle
    1. Much faster and less tiring than walking.
    2. Requires minimal investment in equipment.
    3. Still requires 3 hours at 10 mph, even without breaks.
    4. Still slow, tiring, and an inefficient use of time.
    5. This is the equivalent of the current SCM system used for PL/1 code at DynoSoft (peerSubmit, peerApprove, etc). It is better than nothing, but much less efficient than other options.
    6. Out-of-pocket cost per day is close to zero.
    7. Productivity cost is $150.


  1. Car
    1. Simple and direct.
    2. Requires some investment to acquire & maintain, but is affordable by anyone.
    3. Requires approximately 30 minutes to travel 30 miles with mostly freeway driving (with typical mid-day traffic).
    4. The fastest option, not tiring at all, and the most efficient use of time. It is also the most flexible option in that it can take you anywhere, quickly, for low cost.
    5. The fact that more than 99% of commuters choose this option is strong evidence that it is best option for the overwhelming number of users. This is the equivalent of the Git SCM system, and is the reason for its exploding popularity.
    6. Out-of-pocket cost is about $0.50/mile, or $15.
    7. Productivity cost is $25.


  1. Train
    1. An option that dates back 200 years.
    2. Used to be the only option (other than walking or horses).
    3. Is able to haul people and cargo in extremely large quantities, and has the lowest cost/mile for cargos over 1000 tons.
    4. Routes are limited and inflexible, restricted to a small number of existing train stations
    5. Schedules are also inflexible, with only a dozen or so stops per day at each station.
    6. To reach the train system from DynoSoft, one would first need a taxi to the nearest SD Trolley station in Mission Valley, then take the Trolley to the Coaster station in Old Town, then take the Coaster to Carlsbad, followed by another taxi to the final destination.
    7. Time required in the best case might be: 15 min waiting for the taxi, 15 min driving to Trolley, 20 min waiting for Trolley, 10 min on Trolley, 20 waiting for Coaster, 50 min on Coaster, 15 min on final taxi. This adds up to a minimum of 2.5 hours travel time, assuming that the meeting time was moved to optimally match the Trolley & Coaster schedule. For inconvenient meeting times, the trip could require 3.5 additional hours (6 hours total).
    8. Cost would be approximately $30 for the taxi (10 mi @ $3/mi), $2.50 for the Trolley, $5.50 for the Coaster, $10 for the final taxi (3 mi), for a total of $47 in fees (note that this total does not include the Trolley & Coaster subsidy paid through the sales tax).
    9. Productivity cost is $125 to $300. This is the real penalty for using the rail system, that a round trip to such a meeting eats up most if not all of the workday. This is a direct result of the inflexible routes that trains follow and the rigid schedule they impose on their users. Note that the train option was only viable at all because a significant portion of the trip occurred in taxicabs.


Git vs. Perforce Summation:
  • Using the train to reach Carlsbad is analogous to using Perforce SCM in the modern world. Perforce has been around since early times in SCM history, and, like a train 200 years ago, it was much better than most alternatives at the time for long distances or large loads. Even then, walking, horseback, or wagons were still better options for most people most of the time, just as most people used SCCS, RCS, or CVS instead of Perforce 20-30 years ago. With the advent of Git we now have the equivalent of personal cars. Git gives us the freedom to go anywhere, at any time, with zero cost. With Git, the only required investment is "learning to drive", which is not difficult (and is required for any SCM system).


  •  As with commuting via the train, Perforce is almost never the best choice for SCM in the modern IT world. While it can be made to work if cost is no object, it is also inflexible and a drain on developer productivity. Git can match or exceed Perforce in any realistic scenario, has much lower costs, and much higher flexibility. Git allows developers to focus on creating quality software instead of following rigid SCM procedures. Git also avoids the recurring costs for a dedicated SCM administrator position, a dedicated SCM server, recurring Perforce license fees, and the overhead of assigning and tracking those licenses.


  • A Suggested Path Forward:
    • Git is already installed and working at DynoSoft
      • DynoTool codebase is already imported and available
    • Gerrit/Jenkins code review/CI system is already installed and working at DynoSoft
      • Existing Java projects could be migrated
      • PL/1 build checks could be added as desired
    • A good way to start using Git/Gerrit would be with a small number of users
      • Conduct training - users learn basic skills
      • Maintain DynoTool codebase & incorporate new defects/projects
      • Work out any transition issues
      • Repeat with a larger number of users
    • Commercial support for git, if desired, can be added in the future
      • Will add expense and complexity compared to basic git usage
      • Can always purchase support in the future as we scale up,
        • If & when advantageous to do so
      • Commercial support is available from several vendors:
        • Github.com
        • Bitbucket.com (Altassian)
        • Git Fusion (a new Perforce product as of October 2012)
          • Perforce has seen the Git tidal wave approaching, and they are trying to say to the world, "Me too".
      • DynoSoft users must still learn basic skills before commercial support can be useful

No comments:

Post a Comment