comparação - perforce x subversion

15
Comparison: Perforce and Subversion Perforce 2011.1 and Subversion 1.7 This document compares Perforce (version 2011.1) with Subversion (version 1.7). Read this compari- son to: • Understand Perforce and Subversion’s major feature differences • See head-to-head metrics for operations like branching, merging, check-ins, and checkouts • Get a general comparison of the effects of scaling on both systems

Upload: leonardo-peres

Post on 26-Dec-2015

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comparação - Perforce X Subversion

Comparison: Perforce and Subversion

Perforce 2011.1 and Subversion 1.7 This document compares Perforce (version 2011.1) with Subversion (version 1.7). Read this compari-son to:

•UnderstandPerforceandSubversion’smajorfeaturedifferences

•Seehead-to-headmetricsforoperationslikebranching,merging,check-ins,andcheckouts

•Getageneralcomparisonoftheeffectsofscalingonbothsystems

Page 2: Comparação - Perforce X Subversion

Comparison: Perforce and Subversion

Table of ContentsExecutive Summary _______________________________________________________________ 1

Overview ________________________________________________________________________ 1

Branching, Merging, and Release Management ______________________________________ 2Subversion ________________________________________________________________ 2Basic Branching and Merging _______________________________________________ 2Branching Model, Dependencies, and Guidance _______________________________ 3

Perforce _____________________________________________________________________ 3Basic Branching and Merging _______________________________________________ 3Branching Model, Dependencies, and Guidance _______________________________ 4

Workspaces and Collaboration _____________________________________________________ 5Subversion ___________________________________________________________________ 5Perforce _____________________________________________________________________ 5

Visual Tools ______________________________________________________________________ 5Subversion ___________________________________________________________________ 5Perforce _____________________________________________________________________ 5

Defect Tracking __________________________________________________________________ 6Subversion ___________________________________________________________________ 6Perforce _____________________________________________________________________ 6

Integration with Related Tools _____________________________________________________ 6Subversion ___________________________________________________________________ 6Perforce _____________________________________________________________________ 6

Remote Development _____________________________________________________________ 7Subversion ___________________________________________________________________ 7Perforce _____________________________________________________________________ 7

Scalability and Performance _______________________________________________________ 8Subversion ___________________________________________________________________ 8Perforce _____________________________________________________________________ 8

Digital Asset Management and Storage _____________________________________________ 8Subversion ___________________________________________________________________ 8Perforce _____________________________________________________________________ 8

Support and Maintenance _________________________________________________________ 9Subversion ___________________________________________________________________ 9Perforce _____________________________________________________________________ 9

Administration and Security _______________________________________________________ 9Subversion ___________________________________________________________________ 9Perforce _____________________________________________________________________ 9

Auditing, Compliance, and Reporting ____________________________________________________________________ 9

Subversion ___________________________________________________________________ 9Perforce _____________________________________________________________________ 9

Benchmarks _____________________________________________________________________ 10Test Platform ________________________________________________________________ 10Test Data____________________________________________________________________ 10Test Results _________________________________________________________________ 10

Appendix A: Detailed Branching and Merging Analysis ______________________________ 12Results Summary _____________________________________________________________ 12Intended Workflow ___________________________________________________________ 12Subversion’s Problems with Base Selection and Merge History _____________________ 12

Page 3: Comparação - Perforce X Subversion

1 Comparison: Perforce and Subversion

EXECUTIVE SUMMARYThechoiceofsoftwareversionmanagementsystemhasaprofoundimpactonthoseinvolvedindigitalassetmanagement,fromsoftwaredeveloperstoartiststomanagers.Aneffectivesoftwareversionmanagementsystemisonethat:

• Providesafullhistoryoftheevolutionofdigitalassets

• Enablesparalleldevelopmentandconcurrentteamactivity

• Helpstheentireteamworkmoreefficiently

• Meetsmoderndevelopmentandscalabilitychallenges

• Isfast,flexible,andreliable

ThisdocumentshowsthatPerforceSoftwareVersionManagementhasmaintaineditscorestrengthsinproductivity,collaboration,branchingandmerging,scalability,andadministration,whileofferinginnovativesolutionsfornewsoftwareversionmanagementchallenges.Subversion,ontheotherhand,hasfocuseditseffortsonaddressingshortcomingsinbasicfunctionality.Althoughthetotalcostofownershiporreturnoninvestmentisoutsidethescopeofthisdocument,itbecomesclearthatPerforceisthestrongersolutionformodernsoftwareversionmanagement.

Attribute Subversion Perforce

Branching, Merging, and Release Management

Subversionoffersbranching,andprovidesbasicmergehistorytrackinginthedestinationfile’sattributes.Subversion’smergealgorithmsdonotoperatewellinallscenarios.Branchingframeworkandreleasemodelaredesignatedbyconvention,withrepository-widehooksavailableforguidance.Dependenciesaremanagedwithexternals.

Perforceautomaticallytracksthehistoryofallbranchoperationswithitsadvancedandmaturemergetrackingmechanisms.Streamsprovidebest-practicesbranchingframework.Granulartriggersandbrokerareavailableforguidance.Dependenciesaremanagedviaflexiblestream,branch,andworkspaceviews,orviaremotedepot.

Workspaces and Collaboration Importantmetadatastoredintheworkspaceonly;corruptionoftheworkspaceisdifficulttorecoverfrom.Noshelvingfacility.Changelistsareaclient-onlyconcept;nowaytoseewhatothersareworkingonorpreventconcurrenteditingoffilesthatcannotbemerged.

Workspacedefinitionstoredonthesharedversioningserviceandcanberecreated.Shelvingofferssimpletaskswitching,taskhandoff,andcodereview.Changelistsaretrackedonthesharedversioningservice.Theopen-edit-submitworkflowprovidestransparencyintocurrentworkandalsohelpspreventconcurrentworkonfilesthatcannotbemerged.

Visual Tools Communitysupportedtoolsavailable;usuallyspecifictoasingleplatformorenvironment.

Fullfeaturedmultiplatformvisualapplication.VisualizationtoolsincludeStreamGraphandMergeQuest.

Defect Tracking NotincludedwithSubversion;usersneedtouseaseparatedefecttrackingsolution.

Perforceprovidesabasicdefecttrackingsystemcalledjobs,andintegrateswithleadingthird-partydefecttrackingsystemssuchasHPQualityCenterandAtlassianJIRA.

Integration with Related Tools Integrationsareavailableviatheopensourcecommunity.

PerforceintegrateswithleadingIDEs,suchasEclipseandVisualStudio,andothertoolsinmanycategories.IntegrationtoolsincludetheDefectTrackingGatewayandseveralfullysupportedAPIs.

OVERVIEW

Page 4: Comparação - Perforce X Subversion

2 Comparison: Perforce and Subversion

BRANCHING, MERGING, AND RELEASE MANAGEMENT

Subversion

Basic Branching and MergingSubversionofferscodelinebranchingusingasimplecopycommandtocreateabranch,andkeepsabasichistoryoftheoperationsattachedtoeachfileindividuallyinfile-keyedattributelists.Subversionmergesareslowandhistoricallyhave

beenproblematicandpronetomergeerrors.Bidirectionalanddivergentmergesaresupportedwithnewerserversandclients,butwithextramergestepsinvolved.1Othercomplexmergingcases,particularlyinvolvingrenamesandtreeconflicts,canbedifficulttoresolve.2Mergingrenamedfilesmayoverwritenewerrevisionsonthetargetbranchorcauseatreeconflict.3

1Forexample,afterpromotingafeaturebranchintothetrunkwithareintegratemerge,thefeaturebranch

cannotbeusedunlessthetrunkismergedinandthatchangeignored.Subversiondoesnotproperlytrack

mergehistoryinthesecases.

2Subversiontreatsarenameasacombinationofacopyanddelete.

3http://svnbook.red-bean.com/en/1.6/svn.branchmerge.advanced.html#svn.branchmerge.advanced.moves

Overview(continued)

Attribute Subversion Perforce

Remote Development Remoteslaveserverscanbesynchronizedfromacentralizedmasterserver.Synchronizationmechanismrequiresthecodingofevent-basedscripts.

P4Sandboxoffersconnectionindependentversioningandprivatelocalbranching.ThePerforceProxyServiceoffersafilecachingsolutionforremoteusers,withminimaladministrativeoverhead.ReplicationServicesprovideafullcopyof“thesharedversioningservices”dataatremotelocationsforread-onlyoperations.

Scalability and Performance SubversiondependsheavilyonCPU-intensiveoperationsthatdonotscalewellwhenworkloadsincrease.SubversionusuallyrunsasanApachemodule.PerformancebenchmarksindicatethatSubversiondoesnotscalewellindemandingenvironments.

Perforce’sarchitectureisprovenandcontinuestoscalewelluptoandbeyondmanyterabytesandtensofmillionsofversionedfiles.Architectedforspeed,Perforcescaleslinearlyandiscurrentlydeployedinenvironmentswith10,000+usersandheavyautomation.Proxy,Broker,replicationservices,andP4Sandboxprovideapowerfulandflexibledeploymentarchitecture.Perforcesupportsaggressivecontinuousintegrationandautomationwithnoimpactonthesharedversioningservice.

Digital Asset Management and Storage

Inefficientatstoringlargedigital(binary)assets.Sharedstorageformetadataandversionedfiles.

Effectivelystoresanykindofdigitalasset.Storageformetadataisseparatefromversionedfilestorage,whichcanusedifferentstoragesystemsfordifferentproductsorfiletypes.

Support and Maintenance Availableatadditionalcostfromthirdparties.Olderreleasesunsupportedaftertwomajorincrements.

World-classtechnicalsupport,training,andprofessionalservicesprovidedbyPerforce.Productssupportedforalongtimewithadefinedsunsettingpolicy.

Administration and Security Severaldeploymentoptionsavailable,oftenrequiringanApachewebserver.Securityoftendoneattherepositoryordirectorylevel.Inconsistenttoolsacrossplatforms.Upgradesoftenmustbedonesimultaneouslyforserverandclient,andsometimesrequiremakingnewworkspaces.

Simple,consistentdeployment.Granularaccesscontrol.Excellentcross-platformsupport.Simpleupgradeprocedureswithgoodinteroperabilityacrossversions.

Auditing, Compliance, and Reporting

UtilizesApacheloggingforauditing.Reportingdoneviacommand-linescripts.

Built-inauditlog.Reportingcanbedoneviacommandline,scriptingAPIs,customSQLqueries,orareportengine.

Page 5: Comparação - Perforce X Subversion

3 Comparison: Perforce and Subversion

STEP 2

STEP 1 STEP 3

STEP 5

STEP 4 STEP 6

STEP 7

1:1 ----2:2 ----

Rev 1

DEV

MAIN

1:1 ----2: foo2 ----

Rev 2

1:1 ----2: bar2 ----

Rev 3

1:1 ----2:2 ----

Rev 1

1: edit1 ----2:2 ----

Rev 2

1: edit1 ----2: foo2 ----

Rev 3

1: edit1 ---<<<<<< .working2: bar======2: foo>>>>>> .merge-right2: ----

Rev 4

CONFLICT

Figure 1: A simple merge scenario in which Subversion causes a merge conflict.

AsonesimpleexampleofacasewhereSubversionmergingdoesnotworkproperly,considerthefollowingscenarioillustratedinFigure1.

Inthisscenario,afilewasbranchedimmediatelyaftercreation,severaleditsweremadeonbothbranches,andsomeofthechangesfromthechildbranchweremergedback.InStep7,wetrytomergethelatestchangesfromtheparenttothechild.Subversionselectsthefirstparentrevisionasthemergebase,whichleadstoanunnecessarymergeconflict.

Thisscenario,andadetailedbranchingandmerginganalysisinAppendixA,showthatSubversioncannothandlemorecomplexmergescenarioswell,andofferslessgranularresolutioninmanysituations.

Branching Model, Dependencies, and GuidanceDevelopmentandreleasemanagementmodelsarebuiltbyconvention,usuallyusingaknowndirectorystructurefordifferentbranchtypes.Hookscanbeusedtoguidethesemodels,althoughSubversionhooksaffecttheentirerepositoryandmustbecodedappropriately.

DependenciesbetweenmodulesorprojectscanbemanagedusingSubversionexternals,whichrequirecarefulconfigurationandusage,andaredisjointinsomesensefromtherestofthe

workspace.ManySubversionoperations,forexample,willnotautomaticallyrecurseintoexternaldirectories.

Multipleproductscanbehousedinasinglerepositoryifthedirectorystructureisplannedinadvance,inwhichcaseserverstorageissharedamongsttheproducts.Alternatively,eachproductcanuseitsownindependentrepositoryandfilestorage,butatthecostofcommunicationandcodesharingbetweenproducts.

Perforce

Basic Branching and MergingThePerforceInter-FileBranchingmodelispowerfulandflexible,capableofbranchingthousandsoffilesrapidlywhileretainingacompletebranchandmergehistory(includingthemethodofresolvingmerges).Insteadofmanuallytrackingallchangesacrossbranches,userscanrelyuponPerforcetomergefilechangesacrossmultiplebranchesautomaticallyandwithfewerconflictstoresolve.Thisenablesavarietyofdevelopmentscenarios,suchascustomer-specificversions,experimentalbranches,personalortaskbranches,andtheclassicreleasebranchingpatterns.Abuilt-ingraphicaltool,RevisionGraph,canbeusedtodisplaythedetailedbranchinghistoryofeachfileforeasyvisualizationofcodepropagation(seeFigure2).

Page 6: Comparação - Perforce X Subversion

4 Comparison: Perforce and Subversion

Perforceinherentlyunderstandstheancestralrelationshipthatfilessharebetweenbranches.Onceachangehasbeenintegratedfromanoriginatingbranchintoatargetbranch,thereisnoambiguitythatthechangeexistsinbothbranches.Therefore,onsubsequentintegrationsfromthetargetbacktotheoriginatingbranch,userswillonlybepromptedtointegratechangesthathaveoccurreddirectlyinthetargetbranch.Thiskindofintegrationpatternisreferredtoasbidirectionalorladdermerging.

Perforce’smergeengineprovidesbothrobustnessandflexibility.Themostcomplexmergescenariosaresupported,includingrefactoring,indirectmerges,andhandlingnon-contentchanges.AdetailedbranchingandmerginganalysisisprovidedinAppendixA.

InthesimplemergescenariodescribedinFigure1,Perforcecorrectlyselectsthemergebaseonthetargetbranch,givingacleanmergewithnoconflicts(seeFigure3).

Branching Model, Dependencies, and GuidancePerforceStreamsprovidealightweightbutpowerfulbranchingmodel.Usingstreams,aproductarchitectcandefinetherelationshipbetweenstreams,andbetweenthemodulesthatcomposeaproduct;thearchitectcanalsodirecttheflowofchange(merges)betweenstreams.Thisinformationisusedtosimplifyandautomatemanyroutineoperationsforusers.

Whenusingeitherstreamsorregularbranching,Perforceoffersseveraltoolstoguideandenforcepolicy.Triggersandaccesscontrolaregranular,whilethePerforceBrokerprovidescommandfiltering.

Dependenciesbetweenmodulesorprojectsaremanagedviaflexiblestream,branch,orworkspaceviews.Alogicalworkingviewofaproductcanthusbeeasilyassembledfromseveralcomponentsdevelopedindependently.Remotedepotssupportcodedropsbetweenindependentrepositories.

Multipleproductscanbehousedinasingledepotoreachinitsowndepot,dependingonaccesscontrolandusagepolicies.Housingproductsinmultipledepotsallowsfordistributionofphysicalfilestorageontheversioningservice,animportantconsiderationforprojectswithlargedatavolumes.Theuseofmultipledepotsiseffectivelytransparenttotheenduser.

Figure 2: Perforce Revision Graph

STEP 2

STEP 1 STEP 3

STEP 5

STEP 4 STEP 6

STEP 7

1:1 ----2:2 ----

Rev 1

DEV

MAIN

1:1 ----2: foo2 ----

Rev 2

1:1 ----2: bar2 ----

Rev 3

1:1 ----2:2 ----

Rev 1

1: edit1 ----2:2 ----

Rev 2

1: edit1 ----2: foo2 ----

Rev 3

Rev 4

1: edit1 ----2: bar2 ----

Figure 3: Perforce selects the correct merge base

Page 7: Comparação - Perforce X Subversion

5 Comparison: Perforce and Subversion

WORKSPACES AND COLLABORATION

SubversionSubversionstoresimportantmetadataandstateinformationintheworkspace.Recoveryfromworkspacecorruptionisoftendifficult,andrequirescreatinganewworkspace.PriortoSubversion1.7,eachdirectoryintheworkspacehada.svnfolder;accidentallydeletingasubdirectoryintheworkspacewouldresultinthatsubdirectorybeingunknowntotheworkspace,evenwhiletheparentdirectorywasintact.InSubversion1.7allmetadataisstoredintherootoftheworkspace,butthenewmetadatastorageformatissusceptibletocorruptionfromconcurrentaccess.

Subversionoffersnoshelvingfacility;storingandsharingworkinprogressrequiresusingabranch.

Subversion’schangelistsareclient-onlyconcepts.ThereisnowayinSubversiontoknowwhatothersareworkingonorpreventconcurrentcheckoutsoffilesthataredifficulttomerge,asSubversiondoesnotofferanopen-edit-submitworkflow.4

Subversionworkspacesusuallyofferasimple,monolithicviewoftherepositorystartingatthepointofcheckout.Sparsecheckoutsallowpruningorinclusionofsomepartsoftherepository,butcouldrequiremanystepsinordertoassemblethepropersetofdataintheworkspace.

4Subversiondoesofferad-hocfilelocking,whichrequiresthelockingusertoissueaspecialcommand.This

lockpreventsotherusersfromcommittingthelockedfile,butdoesnotpreventthemfromworkingonitin

thefirstplaceunlessaspecialfilepropertyisset.

Perforce AllimportantmetadatainPerforceisstoredonthesharedversioningservice.Recreatingalostworkspace(apartfromactualunsavedfilecontent)issimple.

Perforceshelvesprovideasimplewaytostoreworkinprogress,switchtasks,andshareworkinprogressforcodereview.

Perforcechangelistsareservice-sidemetadata,allowingalluserstoseewhatfilesarecheckedout.Perforcecanalsopreventconcurrentcheckoutsoffilesthataredifficulttomerge,whichhelpspreventwastedtimeandeffort.Perforcesupportsbothanopen-edit-submitworkflowandanedit-open-submitworkflow.

Perforceworkspaceviewsprovidealayerofabstractionbetweentheservice’sviewofthedataandtheviewonaworkstation.Usingaworkspaceview,ausercanpickandchoosedifferentpiecesofasharedrepositorytoview.Theviewiscapturedandversionedasimportantmetadata.

VISUAL TOOLS

SubversionCommunitysuppliedtoolsareavailableformostplatforms,buttheretendstobeadistinctionbetweenWindowsandotherplatforms.

Perforce Consistentvisualtoolsareavailableforallmajorplatforms.InnovativevisualizationslikeStreamGraph,Time-LapseView,MergeQuest,andHTML5applets,greatlyenhanceuserproductivity(seeFigures4-6).

dev2.3

rel2.1 rel2.2 rel2.3

main

Figure 4: Perforce Stream Graph

Page 8: Comparação - Perforce X Subversion

6 Comparison: Perforce and Subversion

DEFECT TRACKING

SubversionSubversiondoesnotincludedefecttracking,butalimitednumberofthird-partyintegrationsareavailable.Defecttrackingintegrationtypicallyreliesonfragilecommitmessageparsing.

PerforcePerforceprovidesabasicdefecttrackingsystemcalledjobs.Ajobtypicallyrepresentsanenhancementrequestorabugtobefixed.Jobdefinitionsarecustomizabletosupportmanyworkflows.Jobscanalsoworkwithseveralthird-partydefecttrackingsystems,suchasHPQualityCenterandAtlassianJIRA.DataenteredintoaPerforcejobisautomaticallyreplicatedinthedefecttrackingtool,andviceversa.Perforcecantellyouwhetherornotabugfixispresentinanyparticularcodeline,regardlessofthecodelineinwhichthebugfixoriginated.

UsingPerforcejobs,userscaneasilylinksubmittedchangestodefectrecordswithoutrelyingoncommitmessages.

INTEGRATION WITH RELATED TOOLS

SubversionTheopensourcecommunitysupportsdifferentSubversionGUIs,aswellasplug-insforworkingwithinpopularIDEs.

PerforcePerforcehasamaturemultiplatformGUI,andthereareplug-insformostofthepopularIDEs.IntegrationtoolsincludethePerforceDefectTrackingGatewayandseveralfully-supportedAPIs.Perforcealsohasintegrationsforpopularapplicationsincluding:

• IDEs

• Webandgraphicaltools

• Softwarebuildtools

• MicrosoftOffice

• Mergeanddifftools

Figure 5: Perforce Time Lapse View

main

dev-1.0dev-2.0

R1.0

0

0

0

0 1+

Figure 6: Perforce Merge Quest

Page 9: Comparação - Perforce X Subversion

7 Comparison: Perforce and Subversion

REMOTE DEVELOPMENT

SubversionWithSubversion,remotedevelopersworkdirectlyagainstlocalslaveservers.Allslavesareconfiguredtosynchronizetheirdatastoresfromacentralizedmaster.Event-basedscriptstriggeredbyupdatesinthemasternotifyeachregisteredremoteslavetosynchronizeitsarchive.Scriptsneedtobecreatedandthendeployedtobothslaveandmasterservers.Eachslaveservermustbeconfiguredtoeitherdenyallwriteaccessorproxywriterequeststhroughtothemasterserver.Iflocalcommitsaredonedirectlyonaslaveserver,thereisnoeasycorrection.

Switchingworkspacesbetweenmasterandslaveserversrequiresthateachuserrunaspecialcommand,makingitdifficulttoautomate.

Third-partycommercialtoolsarenecessarytoachieveadditionallevelsofperformanceatremotelocationsatanadditionalcost.

Perforce RemotedevelopmentwithPerforcedoesnotrequireanyadditionalprocessoverheadoradditionalcost.SeveraltoolssupportremotedevelopmentwithPerforceandaretypicallytransparenttotheenduser.

P4Sandboxsupportsconnectionindependentversioning,privatelocalbranching,andfastlocaloperations,inadditiontoitsotherworkflowbenefits.

PerforceproxiesatremotelocationssupportPerforce’sremotearchitecture(seeFigure7).ThePerforceProxycachesandservesfilestousersatremotelocations,therebyreducingtrafficacrossslowerWANlinks.Allusers,localorremote,connecttothesamesharedrepository,andlookatthesameprojectfiles.ThePerforceProxyrequiresminimaladministrativeattention.

PerforceReplicationServicesprovidecompletelylocalread-onlyoperationsforremoteusers.AsalargepercentageofPerforceoperationsareread-only,usingalocalReplicationServiceoffersasignificantperformancebenefit.

Shared Versioning Service

Proxy Service

ReplicationService

P4Sandbox P4Sandbox

Figure 7: Perforce’s built-in distribution

Page 10: Comparação - Perforce X Subversion

8 Comparison: Perforce and Subversion

SCALABILITY AND PERFORMANCE

SubversionWithSubversion,thebinarydeltadifferencingschemeusedtoversionbothbinaryandtextfilesconsumesalargeamountofCPUtimeontheclientandserver.Thisisespeciallyproblematicwhenthefilesarelargeandtherearemanyconcurrentuserscompetingforthesameresources.PerforceeasilyoutperformsSubversioninallequivalentversioningoperationsduringcomparativebenchmarkingtests.

Onaqualitativenote,somevisualtoolsprovidedbypopularSubversionGUIscantakeanexcessivelylongtimetopresentinformation.Onarepositorywith13,000revisions,forinstance,theTortoiseSVNrevisiongraphtakesoverthreeminutestoloadarevisiongraphforasinglefilewithonlythreerevisions.

PerforcePerforceisarchitectedfirstandforemostforspeed.ThereversedeltaRCSformatfortextandGZipcompressiononbinaryfilesmeansusersdonotwaitforcheck-insandotherstandardoperations.Perforcescaleslinearly,sothereisnoperformancepenaltyimposedbythenumberofrevisionsorthesizeofanygivenfile(s).ThePerforceVerioningServicehasbeendeployedsuccessfullyinenvironmentswithseveralthousandusers,terabytesofversionedcontent,andmillionsofrevisions.Perforce’sdeploymentarchitecturenowincludesproxies,brokers,replicas,andP4Sandbox;thesetoolscanbedeployedinmanycombinationstosatisfydemandingenvironments.ReplicationServicesareparticularlyusefulforsupportingautomatedprocessessuchasaggressivecontinuousintegration;theperformanceburdenofsuchprocessesisshiftedentirelyawayfromtheproductionserver.

DIGITAL ASSET MANAGEMENT AND STORAGEAmodernversionmanagementsystemmustbeabletoeffectivelystoreandmanageanykindofdigitalasset,fromsourcecodetographicstochipdesigns.Otherwiseasecondsystemwillbenecessaryforstoringthesenon-textassets,whichrequiresextraoverhead,administration,andprocess.

Subversion Subversioncannoteffectivelystoreandmanagelargedigitalassets.ItsbinarydifferencingalgorithmimposesasevereCPUburdenontheclientworkstation,withunacceptableperformancedegradation.Additionally,aSubversionworkspacemaintainsapristinecopyofallfilecontentinadditiontotheactualworkingcopies.Withlargedatavolumes,thiscouldimposeaburdenonthetypicalworkstation.

Ontheserver,storageforasinglerepositoryisonasinglefilesystemforthemetadataandallversionedfiles,givingtheadministratorslittleflexibilitytodealwithlargedatavolumes.Subversionslaveserverscanbeusedtooffloadfiletransferwork,butswitchingworkspacesfromthemasterservertotheslaverequiresamanualstepbyeachuser.

PerforcePerforceisusedbycustomerstostoreandmanageterabytesofdigitalassetsofalltypes.Perforce’sefficientworkspacemanagementimposeslittleoverheadonclients.Onthesharedversioningservice,storagecanbepartitionedbetweenthemetadataandseveraldepotsforversionedfiles,givingadministratorsgreatflexibilityinplanningstoragesolutions.Ifmoregranularityisnecessary,particularfiletypescanbemanagedinseparatestorage,andunnecessarydatacanbearchivedtoofflinestorage.Perforcealsooffersseveraleasy-to-deploytoolsthataretransparenttobothendusersandtheprocessforoffloadingfiletransferworkfromtheprimaryservertosupportcontinuousbuilds,automation,andremoteusers.

Page 11: Comparação - Perforce X Subversion

9 Comparison: Perforce and Subversion

SUPPORT AND MAINTENANCE

SubversionSubversionoffersfullaccessibilitytothesourcecode,buttheadministratormustinvestthetimeandefforttobecomefamiliarwiththecodebase.Commercialthird-partysupport,training,andservicesarealsoavailable.Subversionstopssupportingolderreleasesaftertwomajorincrements.Forinstance,whenSubversion1.6wasreleased,supportforSubversion1.4wasdiscontinued.

PerforceExpertandresponsivetechnicalsupportisahallmarkofPerforceandfulltechnicalsupportisincludedduringanevaluation.Perforcebelievesthatwhenyoubuyasoftwareversionmanagementsystem,youarenotonlyputtingyourfaithinthesoftware,butalsointhetechnicalsupportyouexpecttoreceive.Becausethequalityofatechnicalsupportorganizationisbetterexperiencedthandescribed,Perforceencouragesprospectivecustomerstojudgeforthemselvesduringatypical45-daytrialevaluation.Perforcealsooffersafullrangeoftrainingandprofessionalservices.Perforceprovidestechnicalsupportforpastreleasesforanextendedduration,andhasadefinedpolicythatprovides12months’minimumnoticebeforeanolderproductisretired.

ADMINISTRATION AND SECURITY

Subversion Subversionrequiresadministratorstomakeseveraldecisionsbeforeimplementation.Forexample,administratorsmustdecidewhethertoconfigureawebserveroruseastandaloneSubversionserver;whichauthenticationandaccesscontrolmechanismstouse;andwhethertouseafile-basedsystemoradatabaseforstoringversionedfiles.Subversionaccesscontrolisnotgranular,andisoftendoneattherepositorylevel,althoughdirectory-levelaccesscontrolispossible.

Subversionimposesextraadministrativeoverhead.Itstoolsetisinconsistentacrossplatforms,forcingusersinmulti-platformenvironmentstoadaptaccordingly.Moreimportantly,theSubversionserverandclientsoftwaremustbeupgradedsimultaneouslyandoften,withmanualupgradestepsrequiredforclients.Insomecases,Subversionrecommendsmakingnewworkspacesratherthanupgradingexistingones.

Perforce Perforcefunctionsthesameregardlessofplatform,andprovidesabuilt-insecuritymechanismwithmanylevelsofaccessthatcanbeappliedtoanysubsetofthearchivedfiles—fromtheentiresharedrepositorytotheindividualfile.Versionedfilesarestoredthesameonallplatforms.

Perforceimposesminimaladministrativeoverhead.Perforcedeploymentissimpleandconsistent.Workinginamultiplatformenvironmentposesnoproblem,andPerforcehasexcellentsupportformixedserviceandapplicationversions.Upgradeproceduresaresimpleandfast.

AUDITING, COMPLIANCE, AND REPORTING

Subversion SubversionreliesonApachefacilitiesforauditlogging.ReportingismostoftendoneusingtheSubversioncommand-lineclient.

Perforce Perforcehasabuilt-inauditlog.ReportingispossibleviathePerforcecommandline,scriptingAPIs,SQLqueries,orreportengines.Thelattertwooptionsmakesophisticateddataminingpossible,andareavailablebecausePerforce’sdatabasecanbereplicatedintoarelationaldatabase.

Page 12: Comparação - Perforce X Subversion

10 Comparison: Perforce and Subversion

Table1:Resultsforequivalentversioningoperationsonasmalldataset(alltimeinseconds).

Operation Subversion (1.7) Perforce (2011.1)

Add tree 20.9 34.0

Lightweight branch 0.3 1.1

Delete tree 1.5 1.0

Label/tag tree 0.3 0.3

Merge edits to entire tree 73.1 16.4

Preview merge (no merge necessary) 4.3 0.2

Sync entire workspace 14.0 1.4

Preview sync (no updates necessary) 1.0 0.6

Restore deleted tree 32.0 36.1

BENCHMARKSPerforceeasilyoutperformsSubversioninallequivalentoperationsduringcomparativebenchmarkingtests.Notably,Subversionperformancedegradesconsiderablyasthenumberandsizeoffilesincreases.Thetestresultsaredetailedbelow.

Test PlatformThecombinedclient/servermachineonwhichthetestswererunhadthefollowingspecifications:

• AmazonEC2highmemoryquadrupleextralargeinstance

• Linuxx86_6464-bitRedHatEnterpriseLinux

• 26ECUs,8cores,68GBRAM

• P4D/LINUX26X86_64/2011.1.BETA/347706

• svn,version1.7.0(r1176462):CollabNetSubversionEdge-2.1.0_linux-x86_64

Test DataThetestdataforthesmallrunconsistedoftheApachewebserverandTomcatapplicationserversourcetrees,totaling46MBand4,480files.Themediumdatasetwasfourcopiesofthesmalldataset.Thelargedatasetcomprised207largebinaryfiles,totaling632MBinsize.

Test ResultsPerformanceresultsforthePerforceandSubversioncomparativebenchmarksarepresentedinthefollowingtables.Responsetimesweremeasuredinseconds.

Page 13: Comparação - Perforce X Subversion

11 Comparison: Perforce and Subversion

Table2:Resultsforequivalentversioningoperationsonamediumdataset(alltimeinseconds).

Operation Subversion (1.7) Perforce (2011.1)

Add tree 79.5 139.7

Lightweight branch 0.7 4.4

Delete tree 4.0 4.0

Label/tag tree 1.0 0.5

Merge edits to entire tree 283.4 62.5

Preview merge (no merge necessary) 11.2 0.4

Sync entire workspace 41.8 5.9

Preview sync (no updates necessary) 1.5 2.5

Restore deleted tree 161.8 160.9

Table3:Resultsforequivalentversioningoperationsonalarge(binary)dataset(alltimeinseconds).

Operation Subversion (1.7) Perforce (2011.1)

Add tree 44.2 51.8

Lightweight branch 0.1 0.8

Delete tree 1.5 1.0

Label/tag tree 0.1 <0.1

Merge edits to entire tree 62.5 10.7

Preview merge (no merge necessary) 3.5 <0.1

Sync entire workspace 62.7 9.4

Preview sync (no updates necessary) 1.0 <0.1

Restore deleted tree 63.0 48.9

Page 14: Comparação - Perforce X Subversion

12 Comparison: Perforce and Subversion

APPENDIX A: DETAILED BRANCHING AND MERGING ANALYSISThisappendixanalyzesseveralcommonproblemswithSubversionbranchingandmerging,withspecificexamples.TheanalysisisgroundedinasetofbranchingandmergingteststhatPerforcerunsinternallyasaregressionsuiteforitsownproduct.Perforcesuccessfullypassesallofthetestsdescribedhere.

Results SummaryOutof141tests,Subversionfailed20.SixothersarenotapplicablebecauseSubversiondoesnotsupportasmanyoptionsduringthemergeandresolveprocess.

Intended WorkflowSubversion’smergingcommandswereintendedtosupportabasicbranch-merge-promoteworkflow.Achildbranchiscreatedfornewwork.Changesfromtheparentareperiodicallymergeddowntokeepthechilduptodate.Whenworkonthechildbranchiscomplete,itispromotedtotheparentandretired.

Wheneveryoubeginworkingoutsidetheboundsofthatbasicworkflow,complexitiesappear:

• Reusingachildbranchrequiresadditionalsteps,asdescribedintheSubversiononlinebook.5

• Workingatthefileratherthanthedirectorylevelismuchmoredifficult.Forinstance,itisdifficulttoreferenceadeletedheadrevisioninSubversion,sopropagatingafiledeleteneedstohappenbymergingtheentiredirectory(andpossiblydealingwithatreeconflict).

• Mergebaseselectionisinefficientwhendealingwithladdermergesorindirectmergehistory,resultinginmoremergecomplexityandconflicts.

• Indirectmergehistoryissometimesignored.Previouslymergedorignoreddeltasmaybereintroduced.

• Subversion’smethodofreachingbranchconvergence,thereintegratemergeoption,isintendedforaveryspecificusecaseandcannotbeappliedelsewhere.IngeneralsituationsSubversionlacksacommandthatforcesconvergenceduringamerge.6

5http://svnbook.red-bean.com/en/1.6/svn.branchmerge.advanced.html#svn.branchmerge.advanced.

reintegratetwice

6Ifthereareconflictsduringamerge,Subversionallowseitherthesourceortargettobeacceptedinfullas

themergeresult.Butoddlyenoughiftherearenoconflictsthecontentswillalwaysbeautomaticallymerged.

Subversion’s Problems with Base Selection and Merge HistorySeveralfailureswereduetopoororinefficientbaseselection,whileotherswereduetofailuretoconsiderpriormergehistory.Subversionseemstofavorpickingamergebaseonthesourcebranch,evenifselectingabaseonthetarget(oranindirectlyrelated)branchwouldyieldamoreefficientmerge.

Insomecasespickingalessdesirablemergebasehaslittleornoeffectontheendresult.Butinsomecases,asdiscussedpriorinBranching,Merging,andReleaseManagement,pickingalessdesirablemergebasecausesmergeconflictsunnecessarily.Thebaseshouldbechosentoreflect,asmuchaspossible,anyexistingmergecredit—revisionsalreadyaccountedforinthemergetarget.Generallyspeaking,pickingamergebaseascloseaspossibletothesourceandtargetrevisionsyieldslessdeltastoconsider,reducingthechancesforconflictsandotherproblems.

Whenamergegivesconflictsandotherproblemswithoutavalidreason,orreintroducespreviouslyconsidereddeltas,usersloseconfidenceinthemergeengine.Besidesthetimeandefforttofixtheimmediateproblem,usersbecomemorelikelytomanuallyverifymerges,whichcanseverelyimpactproductivity.

Onarelatednote,Subversionquiteeasilyallowsmergingbetweenfilesordirectorieswithnoancestry.Subversion’smergecommandoriginallyhadtoassumenoinformationaboutmergeancestry,asSubversiondidnotoffermergetrackinguntilthe1.5release.Althoughbaselessmergesareoccasionallyuseful,theyshouldnotbeavailablewithoutspecificuseracknowledgement,inordertopreventaccidentalmerges.

Furtherexamplesofimproperbaseselectionandmergehistoryhandlingaredetailednext.

Page 15: Comparação - Perforce X Subversion

North America Perforce Software Inc.2320 Blanding AveAlameda, CA 94501USAPhone: +1 [email protected]

EuropePerforce Software UK Ltd. West Forest GateWellington RoadWokinghamBerkshire RG40 2ATUKPhone: +44 (0) 845 345 [email protected]

Australia Perforce Software Pty. Ltd.Suite 3, Level 10221 Miller StreetNorth SydneyNSW 2060AUSTRALIAPhone: +61 (0)2 [email protected]

p e r f o r c e . c o m

Copyright © 2012 Perforce Software Inc. All rights reserved. All trademarks or registered trademarks used herein are property of their respective owners.