[{"data":1,"prerenderedAt":393,"buildId":394},["ShallowReactive",2],{"docs:\u002Fguide\u002Fspeed":3},{"page":4,"section":16,"document":17,"credits":10,"prev":386,"next":389},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"speed","\u002Fguide\u002Fspeed","guide\u002Fspeed.md","How it stays fast","whatfrees asks the owner of each thing first, walks only what no one sized, stops at a deadline, and counts a hard-linked file once.",null,[],"i-lucide-gauge","article",true,3,"guide",{"nodes":18,"toc":379},[19,23,31,34,100,107,113,116,143,174,224,230,236,239,289,299,306,312,315,353,359],[20,21,22],"p",{},"A scan has a budget of 5 seconds. Three habits keep it inside that.",[24,25,30],"h2",{"id":26,"anchor":27},"owners-first",{"label":28,"icon":29},"Section titled \"Owners first\"","#","Owners first",[20,32,33],{},"The owner of a thing already knows its size and its state. whatfrees asks the owner before it reads a single file.",[35,36,37,72,86],"ul",{},[38,39,40,44,45,49,50,53,54,53,57,60,61,64,65,67,68,71],"li",{},[41,42,43],"strong",{},"Git."," A checkout's ",[46,47,48],"code",{},".git"," file, ",[46,51,52],{},"HEAD",", ",[46,55,56],{},"commondir",[46,58,59],{},"packed-refs"," and stash log are read from disk. No subprocess runs for them. One ",[46,62,63],{},"git rev-list"," per repository tells which ",[46,66,52],{},"s no remote has. ",[46,69,70],{},"git status"," runs only for a checkout nothing cheaper has decided.",[38,73,74,77,78,81,82,85],{},[41,75,76],{},"The process table."," One read of every working directory (",[46,79,80],{},"\u002Fproc"," on Linux, ",[46,83,84],{},"lsof"," on macOS) tells which checkouts are in use.",[38,87,88,91,92,95,96,99],{},[41,89,90],{},"Settings files."," The pnpm store path comes from the environment, ",[46,93,94],{},"pnpm\u002Frc"," and ",[46,97,98],{},"~\u002F.npmrc",". pnpm doesn't start.",[20,101,102,103,106],{},"A source that can't answer in time is skipped and named in ",[46,104,105],{},"skipped",". The rest of the report still prints.",[24,108,112],{"id":109,"anchor":110},"a-walker-with-a-deadline",{"label":111,"icon":29},"Section titled \"A walker with a deadline\"","A walker with a deadline",[20,114,115],{},"What no owner sized, a pool of four worker threads walks. It never follows a symlink and never crosses into another file system.",[20,117,118,119,122,123,53,126,53,129,53,132,135,136,139,140,142],{},"The likeliest deletions go first: ",[46,120,121],{},"orphan",", then ",[46,124,125],{},"safe",[46,127,128],{},"ask",[46,130,131],{},"unchecked",[46,133,134],{},"unsaved",", and ",[46,137,138],{},"live"," last. ",[46,141,70],{}," gets half of what is left of the budget, and sizing gets the rest.",[20,144,145,146,149,150,153,154,157,158,161,162,165,166,169,170,173],{},"When the deadline comes, a tree still being read returns what was counted so far. Its ",[46,147,148],{},"precision"," is ",[46,151,152],{},"lower-bound",", and the text report prints it as ",[46,155,156],{},"≥4.2 GB",". A tree the walker never reached is ",[46,159,160],{},"unmeasured",". The report sets ",[46,163,164],{},"partial"," to ",[46,167,168],{},"true",", and its ",[46,171,172],{},"next"," list suggests a longer budget.",[175,176,177,190],"table",{},[178,179,180],"thead",{},[181,182,183,187],"tr",{},[184,185,186],"th",{},"Flag",[184,188,189],{},"Effect",[191,192,193,204,214],"tbody",{},[181,194,195,201],{},[196,197,198],"td",{},[46,199,200],{},"--budget 10",[196,202,203],{},"Ten seconds for the whole scan",[181,205,206,211],{},[196,207,208],{},[46,209,210],{},"--budget 0",[196,212,213],{},"Owners answer, nothing is walked. Owners get a short floor even then",[181,215,216,221],{},[196,217,218],{},[46,219,220],{},"--exact",[196,222,223],{},"No deadline and no size cache. Every tree is read to the end",[24,225,229],{"id":226,"anchor":227},"bytes-that-come-back",{"label":228,"icon":29},"Section titled \"Bytes that come back\"","Bytes that come back",[20,231,232,235],{},[46,233,234],{},"du"," counts a file once however many links it has. That isn't what deleting frees. A file with a second link outside the folder stays on disk.",[20,237,238],{},"whatfrees counts disk blocks per inode and splits them in two:",[175,240,241,251],{},[178,242,243],{},[181,244,245,248],{},[184,246,247],{},"Field",[184,249,250],{},"Meaning",[191,252,253,263,273],{},[181,254,255,260],{},[196,256,257],{},[46,258,259],{},"frees",[196,261,262],{},"Blocks of files whose links are all inside the folder",[181,264,265,270],{},[196,266,267],{},[46,268,269],{},"shared",[196,271,272],{},"Blocks of hard-linked files that a link outside the folder keeps",[181,274,275,280],{},[196,276,277],{},[46,278,279],{},"apparent",[196,281,282,285,286,288],{},[46,283,284],{},"frees + shared",", what ",[46,287,234],{}," prints",[20,290,291,292,295,296,298],{},"A pnpm or bun project links its ",[46,293,294],{},"node_modules"," files to the store. Deleting the project frees little of them, and deleting the store frees little while projects still link to it. ",[46,297,269],{}," shows that.",[20,300,301,302,305],{},"Sizes come from ",[46,303,304],{},"st_blocks",", so a sparse file counts the blocks it uses, not the length it claims.",[24,307,311],{"id":308,"anchor":309},"partial-results",{"label":310,"icon":29},"Section titled \"Partial results\"","Partial results",[20,313,314],{},"A report is always whole entries. A budget cut never leaves half an entry. Three fields say what is missing:",[35,316,317,324,340],{},[38,318,319,149,321,323],{},[46,320,164],{},[46,322,168],{}," when a source or a walk didn't finish.",[38,325,326,328,329,53,332,335,336,339],{},[46,327,105],{}," names each source that had no answer, with ",[46,330,331],{},"budget",[46,333,334],{},"error"," or ",[46,337,338],{},"remote"," as the reason.",[38,341,342,343,346,347,352],{},"Each entry's ",[46,344,345],{},"bytes.precision"," says how far to trust its size. See ",[348,349,351],"a",{"href":350},"\u002Freference\u002Freport#precision","the JSON report",".",[24,354,358],{"id":355,"anchor":356},"the-size-cache",{"label":357,"icon":29},"Section titled \"The size cache\"","The size cache",[20,360,361,362,365,366,369,370,374,375,378],{},"A single file's size is stored in ",[46,363,364],{},"measure.json",", keyed by path and modification time, and checked against the file's current blocks and link count before it is used. A hit sets ",[46,367,368],{},"cached: true"," on the entry. Directories are never cached, because a directory's stat says nothing about what is under it. See ",[348,371,373],{"href":372},"\u002Fguide\u002Finstallation#where-the-size-cache-goes","Installation"," for the folder. ",[46,376,377],{},"--no-cache"," skips it.",[380,382,383,384,385],{"id":26,"depth":381,"text":30},2,{"id":109,"depth":381,"text":112},{"id":226,"depth":381,"text":229},{"id":308,"depth":381,"text":311},{"id":355,"depth":381,"text":358},{"path":387,"title":373,"description":388},"\u002Fguide\u002Finstallation","Run whatfrees once with npx, install it as a command, or add it to a Node program as a library.",{"path":390,"title":391,"description":392},"\u002Fguide\u002Fverdicts","Verdicts","What each whatfrees verdict means, which facts decide it, and which ones an agent may act on.",1796464608359,"84b4d453-0d43-4339-8103-d1d78e551efe"]