CSLNotebookEntryToCedarusersDateMarch30,1983FromEdTaftLocationPaloAltoSubjectBTreepackageOrganizationPARC/CSLXEROXReleaseas[Indigo]Documentation>BTree.tiogaDraft[Indigo]Documentation>BTree.tiogaLasteditedbyTaft,March30,19839:42amAbstractThisCedarpackagemaintainsanorderedcollectionofobjectsasaBTree.Theobjectsmaybeofdifferentsizes,andtheremaybealargenumberofthem(tensorhundredsofthousands).TheamountofvirtualmemoryrequireddoesnotdependonthesizeoftheBTree,andthecostoffinding,inserting,anddeletingobjectsincreasesonlyveryslowlyastheBTreegetslarger.Thepackagemakesveryfewassumptionsabouttherepresentationoftheobjectsbeingstoredoraboutthepropertiesofthestorageitself.ThismemogivesanoverviewoftheoperationoftheBTreepackageandpresentstheresultsofsomeperformancemeasurements.IntroductionABTreeisadatastructureformaintaininganorderedcollectionofobjects(orentries)storedasatreeoffixed-sizepages.Theentriesareeachsmallerthanapageandarestoredmanyperpage;thus,eachinteriorpageofthetreehasmanybranches,soevenaverylargetreeisquiteshallow(adepthof3or4istypical).Thismeansthatfindinganarbitraryentryisrelativelyinexpensiveintermsofthenumberofpagesthatmustbeaccessed.Thecostofanupdateisalsoreasonableandhasanupperboundwhichislinearinthedepthofthetree.Finally,thetreehasverygoodlocality,soreferencestoconsecutiveentriesusuallyaccessthesamepage.ForfurtherinformationonthepropertiesofBTreesingeneral,pleasereadKnuth,TheArtofComputerProgramming,vol.3,section6.2.4.ThisBTreepackageisaCedartransliterationofonewritteninBCPLbyEdMcCreightandusedformaintainingthefiledirectoryinIFS.TheimportantpropertiesthatdistinguishitfromexistingMesaBTreepackagesare:GeneralitytheBTreepackagemakesnoassumptionsabouttherepresentationofentries;itsimplystoresuninterpretedblocksofwords.Itneedknownothingaboutwhatportionofanentrycontainsthekey''orthevalue''.Allknowledgeabouttherepresentationofentriesisvestedinclient-providedprocedures.ThepackagealsomakesnoassumptionsaboutthemeansusedtostoretheBTreepages,butinsteadcallsclient-providedprocedurestoaccessthem.Capacitythereisnopracticallimittothenumberofentriesthatcanbestored.Inparticular,thereisnorequirementthatallofthepagesoftheBTreeoccupyvirtualmemoryatthesametime.Theultimatelimittothesizeofthetreeis65,535pages,whichshouldbesufficienttostoreatleastamillionentriespîÆïaïî§î ?qî ìï^rîòï^î qî+¯ï^rî6ï^î:kî<¨qî ìïZrîòïZî%qî+¯ïZsî6ïZî9qî ìïV4rîòïV4îqî+¯ïV4 rî6ïV4sî:–ïV4î;“ïV4tî{ïNˆqî ìïDˆî ôsî¬ïDˆrî%3ïDˆî&ïDˆ qî ìïBÚrî¬ïBÚsîïBÚî”ïBÚrî&}ïBÚî'.ïBÚ qî ìïA,î Vî¯sî¬ïA,îþîdî¡îçî!öqî ìï>¤sî¬ï>¤îºîÅîûî$.î&î+& î1Nî2ûî7‹î9-î:Jî?/îAúîF‹î ìï<ýî êî ±îdîúî¿îVî gî"fî#�î'î,Lî.î1©î5î6åî=î>Î îF·î ìï;VîÿîÁî#î™î 1î#jî%çî*Úî,èî/Pî2î3Åî6-î:°î=oî?×îB­îDnî ìï9® îöî»î î´î"‡î%®î(Êî-î.Êî17î5fî8Aî="î@îEVî ìï8î ÷î” îRî/î‹ î&~î(3î*�î/(î2ïî7î8Îî<¬î? îEzîG/î ìï6`î½î2îjîÁîQî `î&Oî(&î*¤î0ìî2Äî5Aî9‚î>ãîA¹îG/î ìï4¸î;îôîˆ îŒ pî ìï0„ rî ìï-$î ~î¦îîGîQîîW î$òî&èî, î2Iî4î8ªuî:íï-$î;ˆï-$rî>½ï-$î?Áï-$îCêîE�îFÍî ìï+|î ¨ îÉîwîRîÆî î#Qî(î+Eî,rî/¼î2vî4Íî8ôî<Âî?:îBýîF^î ìï)ÕîÝî+îìîSîîšîlî%“î'_î*­î+Þî.õî2cî5-î6¡î:2î?.î@ÙîDÎîF�îGËî ìï(.î î €î9îMî‹îSî!î"ÿî(žî,+î-‘ î3| î:êî<’î@WîB îDbî ìï&†î ›î[îî}îcî¤î rî#5î$äî&Êî+Rî,´î/v î6:î8çî;Rî=8îA0îE�î ìï$ßî gîVîî�î}îEî´îoî$ˆî&öî)Çî,Kî/iî2êî8î9ì î@}îB: î ìï#8î\îîî|îùî ìï °î �î2 îµî´î î#|î%.î)Îî+uî0™î4µî7Éuî<‚ï °î=iï °î?>îA®îCJî ìï rîëïîÈïîrîÿîœî ìï€î îWî°î3îtî£î&zî(Kî+ î/Øî1�î5Öî7éî:3îA0îCþîGRî ìïÙ î˜îîŽîvî:î!úî$éî+a î1îî4Ó î;Úî=Gî@ÅîEåî ìï1îîÕvî ìï© rîï©î€ï©îÇîÒîüî!î# î*µî.î0Æ î9¥î;Fî@îAVîE®î ìï îƒî½îmîCî±î"î%ºî*Æî.Ÿî1òî6Èî8wî:^î=éîCCîE™î ìïZî ›î æ î¢îàî°î }î"Ç î+ªî-Nî1©î3î7%î8¾îB0 î ìï³î µîéî§îÑîÈ î"|î&Oî( î,Õî0î1¢î4ðî7Aî;Uî?iîAÛîF€î ìï îs îzî)î 6vî ìï ƒrîï ƒîxï ƒîîvî�î î Vî"î$lî)�î+[î/Ïî2¢î52î7'î îD•îH#î ìï Üî â îŸî\î<îäî3îíî!–î#åî'öî,™î0ãî6@î7Èî:î=„îAdîD+î ìï 5î 6îéîMîüî¹îîãîSî ¦î$Íî(ßî-_î/T î5Wî7 î:jî<î?0î@^îEÿýTVm$2(evenmoreifpages''largerthan256wordsareused).Storageefficiencyoverheadconsistsofonlyonewordperentryandtwowordsperpage;andthepackagemaintainspagesbetween60and80percentfullontheaverage.Thepackagealsoattemptstokeeplargerentriesintheleafpagesandsmalleronesintheinteriorpagessoastominimizethetree'sdepth.Provenreliabilitysincethelast''bugwasfixedintheBCPLversionofthepackage,therehavebeenmanytensofthousandsofIFS-hoursofoperationwithnosuspicionofaBTree-relatedproblem.NochangesweremadetotheBTreemaintenancealgorithmsduringthetransliterationtoCedar.Itisintendedthatthispackagebesuitableforuseinmaintaininganyordereddatastructurethatmustbestoredexternally,i.e.,iseitherpermanentoris(potentially)toolargetokeepinvirtualmemory.Themostobviousapplicationisafiledirectory.Forsmallerapplicationsinvolvingtemporarydataonly,aninternaldatastructuresuchasaRedBlackTreeismoreefficienttoaccessandmaintain.InstructionsforuseTheprimarydocumentationfortheBTreepackageistheinterfaceBTree.mesa,obtainedviaBTree.df.Thefollowingisanoverviewofhowthepackageisintendedtobeused;consulttheinterfaceitselffordetails.Theclientmustprovidetwosetsofprocedures,calledtherepresentationprimitivesandthestorageprimitives.TheBTreepackageisobject-oriented,i.e.,asingleinstantiationofthepackagesufficestodealwithanarbitrarynumberofTreeobjects;andeachTreeobjectinstancecanhaveanindependentsetofrepresentationandstorageprimitivesassociatedwithit.TherepresentationprimitivesenablethepackagetofindouteverythingitneedstoknowaboutBTreeentriesandkeys.ThemostimportantareEntrySize,whichgivesthesizeofanentryinwords,andCompare,whichgivestheresultofcomparingakeywithanentry(less,equal,orgreater).ThepackagedoesnotdoanythingwithkeysbesidesComparethemtoentries.Additionally,thereareproceduresforconvertingbetweenREFandLONGPOINTER(i.e.,safeandunsafe)referencestoentries.ThestorageprimitivesarethemeansbywhichthepackageaccessesthepagesinwhichtheBTreeisstored.ThepackagegainsaccesstothecontentsofapagebycallingtheReferencePageprocedure,whichreturnsaLONGPOINTERtoablockofvirtualmemorycontainingacopyofthatpage.Whenthepackageisfinishedwiththepage,itcallsReleasePage;subsequently,thepagestorageimplementationmayrewritethepagetopermanentstorage(ifdirty)andreclaimthevirtualmemory.Thepackagecomesintwoparts.Themainpart,BTreeImpl.bcd,exportstheBTreeinterface.Additionally,thereisanexampleimplementationofthepagestorageprimitivescalledBTreeVMImpl,whichexportstheBTreeVMinterface.ThisimplementationisintendedforbuildingatemporaryorpermanentBTreeonrawPilotfiles(or,eventually,CedarNucleusfiles).ItmaintainsaVMcachewhosesizeisspecifiedbytheclient;anditreadsandwritesthefileexplicitly,usingSpace.CopyInandCopyOut.TheideaisthattheclientprogramfirstcallsBTreeVM.Open,passingafilecapabilityandobtainingastoragehandleandasetofstorageprimitives.These,alongwiththeclient'srepresentationprimitives,shouldthenbepassedtoBTree.Open,whichreturnsaTreehandleuponwhichBTreeoperationsmaybeperformed.ThereisnoexplicitCloseoperation.TheTreeandstoragehandlesarecollectibleobjects,whichvanishwhenthelastREFstothemdisappear.(Note:itisintendedeventuallythatthespaceoccupiedbytheBTreeVMcachewillbefreedwhenthestoragehandleisgivenup.Atpresent,however,thisisnotdone;socacheSize*filePagesPerPagepagesofVMarelost.)Performance2rî ìïb!î ¬î?îŸîËî¶îÜî!rî%î'Òvî ìï_jî< rîÔï_jî5ï_jîWî!‡î#pî&¹î)”î-Mî/ñî3µî6œî9xî=´î@YîDHîG/î ìï]Ãî6î~îQîÈî µî#tî%bî*Tî,çî.öî1]î7Iî:)î?sîBHîGàî ìï\î Iî@î¼îuîàî—î nî#1î(î+?î,ùî/dî4Yî8/î9ÿî;¸î=rîC…îEðî ìïZtvî ìïW¾î› rî4ïW¾î•ïW¾îîyîbî".î$âî(hî*î,ˆî0³î5ƒî7Eî9­î?QîBãîF2î ìïVî ÊîÁîŽîîæî!{î#Hî)…î,´î.Íî4ßî6«î7é î@¥îG-î ìïToîîiî)îØî7îZ î&^ î-"î1’î3òî<²î>`î ìïQ¹î lî áî§î~î)îtînî$�î&Ôî)Rî+ î2§î5Qî:{î=‰îCOîF'î ìïPî Ðîè î‰îîpîPî%*î&áî(A î/÷î2Tî5¯î7Qî:–î<8î@†îF·î ìïNjî Mîs îŠîûî*î˜ î%Pî(î,Í î4iî:uîAîD'îGžî ìïLÃîîîÄîõî£îÍ î&Ãî(/î+Âî1î2Éî6Öî9Žpî ìïHR îî¥rî ìïD´î ×î î™îèî Zî$�î)äî+bî-Ôî3Œ î;jîA-îC}î ìïC î ÉîàîPîEîîØî áî#Eî(Œî)üî/½î1pî3eî7î;âî>FîCðîGRî ìïAeî ìï>¯î îüî îçîÎî«î!  î);î-nuî0 ï>¯î0Žï>¯ î8ù rî?Wï>¯î?ýï>¯îBJuîDæï>¯îEjï>¯î ìï= rîŠï=î$ï=îîYî¸îAî)2î+ãî-*î12 î9(î:þî=zîBÙîGàî ìï;`î îîî î¸îìî®î!ñî'î)Ðî- î0Mî4nî9Äî î@T îGRî ìï0e î°qîï0eîóï0erîÏï0eîtï0eqî†ï0eî?ï0eî\rî$ãï0eî%\ï0eî'ðî*½î-tî2H î8Êî:xî ìï-¯î âî³ î<î®î+î!�î#§î'Óî*Qî/±î5î7„î;mî=9îAeîCãîH#î ìï,î8î6îžîMî€î!Uî#Ûî)pî+Oî,Ÿî0 î2.î6¹î9? îB´ î ìï*`î ÷î¨qîÏï*`îˆï*`î¤rî(ï*`î—ï*`îÔîûî#¹î%oî)Çî/2 î5éî7î:`î<î>âîCîGî ìï(¹îDîÅîîMîÂîvî âî$ î,m î5î7Œî:èî?° î ìï'î ðî—î÷î=îìîÑî$„î&^î*)î,àî1¿î4î8xî ìï$[î 2îãîî›îµî!Õî%î)î,± î6òî<4î?îC’ î ìï"´ îHîçîhînîý î(òî*Àî-6î0’î5Z î;Üî?é î ìï! îîî›î6 î#î&@ î0Cî1Óî7´î:î?µîAîGËî ìïeî¿îÏîÃî\î�îkî!î î(Ëî,Ñî2î69î7žî=Ëî>âîA§îEaî ìï¾î ~î ÐîrîTîšîºîWî”î#î%·î)Ÿî+åî.5 î4[î7ë î@œîC9î ìïî ÓîÛîVî3î¡îqî î"õî& î0Žî5qî6©î9" î?qîB7îHeî ìï`î¬îAîî=îhî.îî î'Qî+¹î/†î2®î5î9Æ îBË î ìï¹îuî¨î¥îîÓ î!ùî&î*Óî, î/Rî3åî7†î;¡î?Ð îF‹î ìïî Ý î ìï[î ìîUîYî+îó î óî#Éî'î)·î.gî3pî5Á îî9î;…î?GîE'îG/î ìï îƒîoî<îMîî Øî#Xî(+î,Óî.`î25î5eî7�î<ÎîBËîE�îGî ìïeî Øuîœïeî7ïerîÓïeuîïeîwïerî!­ïeî"tïeî%xî'1î* î,\pî ìï ô wî)Èïöÿ ¥TVm$�TheperformanceoftheBTreepackagedependsonmanyvariables:treesize,pagesize,accesspatterns,cachingbehaviorofthestorageprimitives,andothers.Afewgeneralstatementsaboutperformanceareofferedhere,followedbysomemeasuredresults.Itiscrucialthatthestorageimplementationincludeasubstantialamountofcaching,managedinanLRUfashion.Inmanysituations,theBTreepackagereferencesagivenpagemultipletimesinthecourseofasingleupdate.Evenignoringthis,inmostapplicationsitiscommonforclientstomakereferencestothesameorclosely-relatedentriesoverashortintervaloftime;theresultinglocalityofreferencehasaperformancebenefitonlywhenredundantstoragereadsareavoidedbyuseofacache.ThesizeofthecacherelativetothesizeoftheBTreecanhaveasubstantialeffectonperformance,astheresultsbelowshow.Additionally,itshouldbenotedthatforalargeBTreeitisdesirabletohavealargepagesize;givenareasonablylargeamountofspaceforacache,itisbettertohaveamodestnumberofrelativelylargepagesthanalargernumberofsmallpages.ThisisbecausethemaincostofperforminganoperationonalargeBTreestoredonadiskisdiskaccesstime(asopposedtotransfertime);andlargerpagesmeanmoreentriesperpage,ashallowertree,andfeweraccessesperoperation.WhenupdatingaBTree,atradeoffmustbemadebetweenthedesireforgoodperformanceandthedesiretomaintainaconsistentpermanentstateofthetree.Ifitisdesiredthatthepermanentstatebeconsistentbetweeneveryupdatethenmorewritesarerequired,thusreducingperformance.TheclientprogramcontrolsthistradeoffbyuseofthemaintainRecomputableStateargumentofBTree.OpenandtheStartLongUpdateandEndLongUpdateproceduresavailableinBTreeVM.Ofcourse,ifconsistencyisbeingmaintainedatalowerlevel,e.g.,bykeepingtheBTreeinanAlpinefileunderatransaction,thennoprovisionsneedbemadeattheBTreelevelformaintainingconsistency.ThemeasurementsbelowwereobtainedusingtheBTreeTesttool,whichisavailableasBTreeTest.bcdfromBTree.df.ThisprogramusesBTreeVMtomanageaBTreestoredinaPilottemporaryfile(whichisdeletedwhenthetoolisdestroyed).Itobtainsparametersfromtheuser,randomlyperformsvariousoperationsonthetree,anddisplaysanumberofperformancestatistics.RunningBTreeTestfromtheUserExecopensaviewercontainingacommandmenu,severaluser-adjustableparameters,andatableofresults.Theparametersare:DiskPages/BTreePagethenumberofPilotpages(256words)perlogicalBTreepage.Thelegalrangeis[1..16].CacheSizethenumberoflogicalBTreepageskeptinBTreeVM'scache[8..255].MaxTreeEntriesthemaximumnumberofentriesthetestprogramwilleverpermitthetreetocontain[100..65535].(Notethattheupperlimitisarestrictionofthetestprogram,notoneimposedbytheBTreepackageitself.)LongUpdatethisbooleanswitchcontrolswhetherornotBTreeVMistokeepthepermanentstateconsistentbetweenupdates.LongUpdate:yes''meansthatwritesareperformedonlywhennecessarytoobtainafreecacheentry.ValidateEveryUpdateturningonthisswitchcausestheentiretreetobecheckedaftereachupdate;thisisusefulonlyduringbasicdebuggingoftheBTreepackage,andisverycostly.AtestisstartedbyclickingStart,andisendedbyclickingStop.Theresultsareupdatedeveryfewsecondswhilethetestisrunning.ClickingInitTreeresetsthetreetoemptybeforethebeginningofatest.(ItisnecessarytodothisafterchangingDiskPages/BTreePageorMaxTreeEntries.)ResetStatsresetsthestatisticstozerobutdoesnotchangethetree.Theresultsare:Treesize,Levels,Entriesthesedescribethecurrentstateofthetree.ThetreesizeisinunitsoflogicalBTreepages.Operations,ms/opthesearethenumberofeachtypeofBTreeoperation(lookup,enumerate,insert,delete,replace)thathavebeenperformedandtheaveragenumberofmillisecondstakenbyeach.Inthecaseofenumerate,whatiscountedisthetotalnumberofentriesenumeratedandtheaveragetime3rî ìïb)î Æ îÌî‡îèî î"Qî'Âî)Êî-– î3Íî6‘î9–î<ßî?äîCôî ìï`‚îèî“îHî¢îP î$î&Âî+·î-?î/Ûî4ª î;_î?< îG;î ìï^Úî´î'îÌîÇî[î#�î ìï\Iî ˆî î­îŸî#îù î%üî+î,N î3Bî8qî:Oî?ÌîEÌîGžî ìïZ¢î «î°î«î¡ î Cî"Îî'î,‰ î36î4‹î8jî;ÜîA�îEVîG/î ìïXúîZî2îzî„î/îÖî$mî'…î)Qî,Ì î4�î5öî7€î=Oî?«îDîEÛî ìïWS îŠîTîÐîiîIî#gî'óî+)î,oî0 î5%î6úî:´î=0îBñîGÖî ìïU¬îêî_îˆ îŒî 4î#Nî'î-¨î2Zî5ùî8Lî=xî?tîAéîC¢îDËî ìïSî Îî„îGî±î‡îoî(î ‘î#Gî% î'tî+ î.5î1†î2º î9”î=jî?z îGáî ìïQsî MîŸî®î î!^î"¶î'4î)'î- î/Úî2î3Eî6®î:Óî<+î=™îClîEîHeî ìïOËî |îìî9îîi î lî#üî)0î+î.ñî1Wî2ªî6÷î8vî: î>,î@îCsîDÆî ìïN$îîÖ îÊî3îî!(î"Tî&Bî+pî-,î0Ìî5wî8“î:î?%îA‡îEîGÖî ìïL} î3î8îvî‘îÐî Kî$‚î(»î*Öî,î/î0—î3šî7¼î:öî=3îBÁîD„î ìïJÖîî»î§îrî1îÄî$5î&ªî*Hî+rî1�î4ªî7bî;,î@dîBÙ î ìïHDî%î îWîóî=î •î$î&/î*î/Ÿî2î6Bî8 î<3 îDWîG/î ìïF�î ÷î®îrî¥ îî#òî',î(îî+Vî/î0‘î1ðî3eî86î; î=vîDdîGžî ìïDõ îKîÁî~îî!Gî$âî(ìî+Hî18î4Eî9þ îBîîEÏî ìïCNî”îåî îñîî!•î#huî%áïCNî&÷ïCNrî6çïCNî7�ïCNî=+î>ý îFØî ìïA§î Pî&îâ î$` î+kî1*î2Üî:6îXî î î¤îîòî²î Jî"ªî&Ìî*î,O î3å î ìï;Çî × îàîÿîcî#&î&âî)Tî0 î3@î7`î8ßî>¬î@l î ìï:î NîÚîïîxîlî%Ýî'†î,—î-»î1Ùî5÷î7 î8Äî<îB£îEî ìï8xî \î5îïîSî$î• î"3î#¯î(} î/ˆî2óî5Wî8­î>æîDÇî ìï6Ñ îšî îîîÑî î!2î&^î( î0 î ìï4?î8îjîaîQî% î)‘î+Kî0@ î7Šî9Cî@5îDþî ìï2˜î] î¼îsî�î"î#¾î(éî+Á î2Èuî ìï0rî=ï0îžï0îþî +î!åî%,î(÷î,î0Žî3î7^î;�î?¥îB~îEÄî ìï._î Xuî ìï+Îrîï+Îîcï+ÎîÂîîî§îî##î&îî* î+·î3 î6Õuî ìï)< rî‚ï)<îâï)<îEîÊî"ùî$µî))î+Œî.î3¬î6[î9bî=Öî@9îBþîD°î ìï'• î†î–î…îî )î#�î%î&g î,ÿî.Øî1Xî4î: î<¢î?nîEîG/î ìï%îîîQuî ìï#\ rî.ï#\î�ï#\îhî×îIî$¸î*>î,:î.çî5•î79î9î<©î?@îF^î ìï!µ îOîÊîÕ î%î(+î,{î/Vî3dî5Äî<”î?ºîC{î ìï î šîßî îÖî¡uî ìï|rîNï|î¯ï|î‹îŽî!,î%bî)˜î+ôî/Ýî2œî4Gî64î;î>·îAåîFíî ìïÕî XîpîŠîûînî!'î"àî%@î)bî.üî1´î3î6.î ìïDî –î?îÉîcî|uî¯ïDîŒïDrî¡ïDî›ïDî"pî#úî(;î*Tuî/ˆïDî0dïDrî25ïDî3ÑïDî6Æî;3î=¥îCîFîî ìïœîîÎî9îÐîHîruî$öïœî%‘ïœrî*Tïœî*Ùïœî.+î0–î3dî5î9cî=¾î@)îF îHeî ìïõî ’î¢î-î`î.îTîî!ouî'kïõî(ïõrî5`ïõî6ïõuî7Cïõî8˜ïõ rî@ÙïõîA1ïõuîBñïõîCïïõrî ìïNî ·î îzî)î,î­îÞî"Sî&ûî)Zî,øî/Ðî4 uî ìï¼î îîƒrî«ï¼î ï¼î�î"îî%Iî* î-9î.ìî1Fî4Úî7­î:jî=î>vî@îC�îE5î ìïîuî ìï ƒ î;rîçï ƒîGï ƒîéîUîÍî$î%äî).î,Vî.(î2cî8¥î>6 îElî ìï Üîiî·îœîúînî$Iî'î)Žî.¤î3èî5¸ î=›îArîC…îGÀî ìï 5î QîFî î'î‹îüî"Fî#·î&î)Hî.{î0:î4° îÿîAdîFiwî)Èï ÔTVm$/perentry.Aninsertisanupdatethatinsertsanentrynotpreviouslypresent,whileareplaceisanupdatethatreplacesanexistingentrywithanewonehavingthesamekey.Insertedandreplacemententrieshavesizesselectedatrandomfrom[2..33].CacheRefs,Hit%thetotalnumberofcallstoBTreeVM.ReferencePage,andthepercentageofthosecallsthataccessedapagealreadypresentinthecache.StorageReads,WritesthenumberoftimesBTreeVMtransferredaBTreepagebetweenthecacheandpermanentstorage.Writes/updatetheaveragenumberofstoragewritesperupdateoperation(insert,delete,orreplace).Totalelapsedtimethetotalnumberofsecondsthetesthasrun,excludingtestoverheadsuchasupdatingtheresultsintheviewer,butincludinganyconcurrentactivityelsewhereinCedar.%R+Wtime,ms/(RorW)thepercentageofthetotalelapsedtimespentwaitingforstoragereadsandwrites,andtheaveragenumberofmillisecondstakenbyeachone.Herearesomeresults,obtainedonaDorado:Testnumber1234567DiskPgs/BTreePg1111114CacheSize200200202020020050MaxTreeEntries2500250025002500600006000060000LongUpdateYesNoYesNoYesNoNoTreeSize190190190190436143601037Levels3333443Entries1961194919441940469134702747048ms/opLookup1.901.9138.826.272.855.040.1ms/opEnumerate0.080.081.821.682.752.990.84ms/opInsert4.7248.848.075.786.411971.9ms/opDelete6.6360.869.510112015485.9ms/opReplace3.9630.144.652.879.885.562.4Hit%1001008281818185Writes/update01.741.281.781.351.801.16%R+Wtime0879193949491ms/(RorW)21.717.018.727.428.328.8Afewthingsareworthnotingabouttheseresults.Test1usesacachelargeenoughtoholdtheentiretreeandneverwritesanypagestopermanentstorage(exceptattheendofthetest,whereitisn'tmeasured).ThisgivesagoodapproximationoftheCPUcostofoperationsperformedona3-levelBTree.Asisevidentfromcomparingtest1'sresultswiththeothers,normallymostofthetimerequiredforaBTreeoperationisspentwaitingforthedisk.Test2isthesameastest1exceptthatthepermanentstateiswrittentostorageattheendofeveryupdate.Tests3and4aresimilarto1and2exceptthatthecacheismuchsmallerthanthetree,somanymorereadsandwritesoccur.Interestingly,thechoiceofwhetherornottowritestorageaftereachupdatehasonlyamodesteffecton%R+Wtimeintests3and4.Thisispresumablybecausemostdirtypagesgetwrittenanywayasaresultofbeingdisplacedduringlaterreferencestootherpartsofthetree.(Thedecreaseinlookuptimefromtest3totest4isagoodindicationthatthisiswhatishappening.)Tests5through7areforamuchlargerBTree.Tests6and7showtheeffectofvaryingthepagesize,givenafixed-sizecache.Itisevidentthatthelargerpagesizeyieldsbetterperformanceinallrespects.Thevariationsintimeperreadorwriteacrossallthetestsarepartiallyexplainableasbeingrelatedtothesizeofthetree(alargertreemeansincreasedtimespentseekingbetweendifferentpagesofit).Variationsamongtestswithequal-sizetreesareprobablyPilotartifacts.Finally,itshouldbenotedthatthetestprogramprobestheBTreeatrandom.Realapplicationsmaybeexpectedtoexhibitmorelocalityintreereferences,andconsequentlyahigherhitrateandlesstime4rî ìïb)î ‡îCî¼î­î?îUî î#î'xî)Žî-Hî/ã î6¬î;þî?ÙîA)îF îGžî ìï`‚î�îjî»îºîÓî!uî$Ÿî%×î(Óî+Žî0î2…î6î9 î?îAÌ î ìï^Úî\î£îÒîÿî˜î ¸î$uî ìï\[ îrîGï\[î¨ï\[î*îrî Àî"œî%Íî'žî7±î:Šî= îDîEðî ìïZ´î ûîÉîCîmî´î‡î#[î% î'iuî ìïX5îêî@rîïX5îxïX5îÔîüî!²î%Xî+Ê î2Áî3çî8î;Iî@´îCîFØî ìïVŽîÒuî ìïT rîMïTî®ïTî î î 9î!òî&¤î*¦î-î1®î7×îŸîCEîFØî ìïKÂîFîýî]î\îˆîA î'î*Îî,Éî/úî ìïICî _î³îFîîîŸî¥î Ïuî ìïFÄî çrîmïFÄî!-ïFÄî(îïFÄî0®ïFÄî8nïFÄî@/ïFÄîGïïFÄuî ìïErîmïEî!-ïEî(îïEî0®ïEî8nïEî@/ïEîGïïEuî ìïCqrîmïCqî!-ïCqî(îïCqî0®ïCqî8nïCqî@/ïCqîGïïCquî ìïAÈ rîmïAÈî!-ïAÈî(îïAÈî0®ïAÈî8nïAÈî@/ïAÈîGïïAÈuî ìï@ rîmï@î!-ï@î(îï@î0®ï@î8nï@î@/ï@îGïï@uî ìï>vrîmï>vî!-ï>vî(îï>vî0®ï>vî8nï>vî@/ï>vîGïï>vuî ìï<Ìrîmï<Ìî!-ï<Ìî(îï<Ìî0®ï<Ìî8nï<Ìî@/ï<ÌîGïï<Ìuî ìï;#rîmï;#î!-ï;#î(îï;#î0®ï;#î8nï;#î@/ï;#îGïï;#uî ìï9zîrîmï9zî!-ï9zî(îï9zî0®ï9zî8nï9zî@/ï9zîGïï9zuî ìï7Ðîrîmï7Ðî!-ï7Ðî(îï7Ðî0®ï7Ðî8nï7Ðî@/ï7ÐîGïï7Ðuî ìï6'îrîmï6'î!-ï6'î(îï6'î0®ï6'î8nï6'î@/ï6'îGïï6'uî ìï4~îrîmï4~î!-ï4~î(îï4~î0®ï4~î8nï4~î@/ï4~îGïï4~uî ìï2Ôîrîmï2Ôî!-ï2Ôî(îï2Ôî0®ï2Ôî8nï2Ôî@/ï2ÔîGïï2Ôuî ìï1+rîmï1+î!-ï1+î(îï1+î0®ï1+î8nï1+î@/ï1+îGïï1+uî ìï/‚ rîmï/‚î!-ï/‚î(îï/‚î0®ï/‚î8nï/‚î@/ï/‚îGïï/‚uî ìï-Øîbrîmï-Øî!-ï-Øî(îï-Øî0®ï-Øî8nï-Øî@/ï-ØîGïï-Øuî ìï,/î2îërîmï,/î!-ï,/î(îï,/î0®ï,/î8nï,/î@/ï,/îGïï,/î ìï)°î î'îFî¡îŸîõî Þî$nî)§î,²î-íî0íî2î5ñî9_î>Pî@îC<îE£î ìï( î äîÒîÒî îáîâî Çî'ãî,Ëî1Ëî3™î6/î9î; î=¡î@»îE îF–î ìï&a îÊîîªîþîš î&òî(Õî+^î.ûî1òî3Õ î:­îA›îCÌîEî ìï$ºîÔîÙî:îîjî!-î#®î%´î)øî-î/\î3Ìî9’î<ãî>‘î@åîCÿî ìï#î )î SîuîŸî îµî!ˆî#Æî&%î ìï ”î îbîìîkîîÓî}îÐî ?î#,î%ªî,®î/þî1ˆî6Zî8'î<øî>¯îA-îDîEÛî ìïìî�î/î}îMî›îî§î!nî"¼î%�î&Ûî+Dî.+î0¤î4‰î6î9þî>ßîBîD—îGËî ìïEî Õî‡îEîî<î! î){î+ùî0]î25î7¢î9„î<î=æîA‚îFSî ìïžî î”îûîî"îÝî šî"“î'Üî*óî,“î/•î0¼î3eî5Yî8eî9à îAîF2î ìïöî 7îúî<îèîÕî|îŸî#cî%î(Øî.Ûî3Dî6c î<Ýî>…îBîE}îG/î ìïOî RuîˆïOî8ïOrîÅïOî(ïOîWîãîíî"8î$§î%Àî'Sî)Ãî*Ûî,+î-9î0� î6àî9’î<î=hî@©îAù î ìïÐî xî±îíî%î}î¾îìîÆî"¶î'¼î+Hî,�î/<î0tî4î6dî:4î;ñî@ÝîCAîF‹î ìï)î  îÊ îèî�îîsî!Rî$ î&€î*kî-±î0]î4Hî8@ î@DîAóîCãî ìïªî Ï îîÒîî‚î§îvî"þî'î)î+{î.–î0ôî6b î=µî?nîCDîGàî ìïî sîGî(î¯îšîeîxîbî#Îî)ÿî-Lî1î60î;ÆîA”îE‡îGhî ìï[ îxîþîî) î!Šî$Ðî'$î,õî0< î ìï Üîìî9î«î’îjî/î…î"î'Œî+þî.Tî2mî3üî9åî= îD¤îGžî ìï 5îËîœî\îîýî Îî#³ î*°î-Š î5ôî7@î;²î=òî@×îC±îFiwî)Èïö $TVm$Espentreadingandwritingstorage.5rî ìïb)î –î‹îBîõwî)ÈïýTVm$ÿ HELVETICAþŸÿ TIMESROMANþŸÿ TIMESROMANþŸÿLOGOü´ÿLAURELþŸÿ TIMESROMANþŸÿ TIMESROMANþæÿ TIMESROMANþY N æ# (/Ó0j/31š±ÚLÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ BTree.tioga30-Mar-83 9:43:40