C web:\sthe\sfiles\spage\swas\sunusably\sslow;\sfix\sthe\squery,\smemoise,\scap\sthe\slist\n\nThree\sseparate\sfaults,\sworst\sfirst.\n\nBranches()\sused\sa\scorrelated\ssubquery\s—\sone\sfull\sscan\sof\scheckin\sper\nrow.\sOn\stcl\s(42,074\scheck-ins,\s1,855\sbranches)\sthat\stook\s434\sSECONDS,\nwhich\sis\swhat\smade\sthe\spage\slook\shung\srather\sthan\sslow.\sOne\sgrouped\sscan\nwith\sSQLite's\sbare-column-with-max\srule,\splus\san\sindex\son\n(branch,\sdate):\s0.042s.\n\n'ls\s--long'\scosts\s~4ms\sper\sfile\sbecause\sit\sreads\seach\sblob\sfor\ssize\sand\nthe\sbinary\sflag,\sso\stcl's\s2,198-path\stip\stook\s8.5s.\sFossil\snever\spays\nthis\s—\sbrowse.c\sbuilds\sa\sdirectory\slisting\sfrom\sits\sown\sindexed\stables\nand\sshows\sno\ssize\sat\sall\s—\sbut\squarry\sreads\sthrough\sthe\sCLI\sby\sdesign,\nso\sthe\sanswer\sis\sto\scompute\sonce:\sa\scheck-in's\sfile\sset\sis\sIMMUTABLE,\sso\nlistings\sare\smemoised\sper\sversion,\sthe\stip\sis\swarmed\safter\seach\singest,\nand\sthe\stree\sop\sresolves\s'trunk'\sto\sits\shash\sso\sthe\spage\sasks\sfor\sthe\nkey\sthat\swas\swarmed.\n\nOnly\sa\shash\smay\sbe\scached.\sCaching\s'trunk'\swould\sserve\sa\sstale\stree\nforever\safter\sthe\snext\scommit\s—\sa\scorrectness\sbug\sdressed\sas\sa\nperformance\sfix\s—\sso\sthe\smemo\srefuses\sanything\sthat\scan\smove,\swith\sa\ntest\spinning\sit.\n\nThe\sbranch\sselector\srendered\severy\sbranch:\s1,855\s