1import{a,r,s,i,o,e,t,x,l,n,c,_,v,M,Ue,z}from"./chunk-e7xk0yn7.js";import{O}from"./chunk-sk34g2c4.js";i();var U={_source:"bun-fuzz run 2026-08-14 (bench/ in oven-sh/bun @ 2f5c180). Bun 1.4.0-canary.1+9cff2a1ae (main 9cff2a1ae79, release build) vs Node.js 26.7.0, Deno 2.9.5, pnpm 11.21.0, yarn 1.22.22, npm 12.0.2; PostgreSQL 18.3; express 5.2.1, ws 8.21.3, postgres.js 3.4.9. Peak RSS is the largest of the 3 runs.",machine:"Linux x64, AMD EPYC 9R14 (64 vCPU), kernel 6.1",runs:"medians of 3",panels:[{id:"install-nextjs",title:"Installing a Next.js app",subtitle:"T3-stack app, 25 direct dependencies, ~220 packages in the lockfile · warm cache · lockfile present · node_modules removed · Linux x64, EPYC 9R14 · every package manager at defaults · medians of 3",unit:"s",dir:"lower",headline:"faster",vsLabel:"npm",href:"https://github.com/oven-sh/bun/tree/main/bench/install",rows:[{label:"bun",sub:"v1.4",value:0.21,memoryMB:12,highlight:!0},{label:"yarn",sub:"v1.22.22",value:1.76,memoryMB:205},{label:"pnpm",sub:"v11.21.0",value:1.92,memoryMB:1431},{label:"npm",sub:"v12.0.2",value:4.45,memoryMB:698}]},{id:"express-https",title:"Serving Express over HTTPS",subtitle:"hello-world app · express 5.2.1 · bombardier -c 50 -d 5s · TLS 1.3 · Linux x64, EPYC 9R14 · medians of 3",unit:"req/s",dir:"higher",headline:"more requests/sec",vsLabel:"Node.js",href:"https://github.com/oven-sh/bun/tree/main/bench/express",rows:[{label:"Bun",sub:"v1.4",value:48243,memoryMB:105,highlight:!0},{label:"Node.js",sub:"v26.7.0",value:25181,memoryMB:142},{label:"Deno",sub:"v2.9.5",value:19243,memoryMB:176}]},{id:"postgres-queries",title:"Querying Postgres",subtitle:"SELECT 100 rows · 100 queries in flight · 100k queries total · localhost PostgreSQL 18.3 · Bun.sql vs postgres.js 3.4.9 · Linux x64, EPYC 9R14 · medians of 3",unit:"queries/s",dir:"higher",headline:"more queries/sec",vsLabel:"Node.js",href:"https://github.com/oven-sh/bun/tree/main/bench/postgres",rows:[{label:"Bun",sub:"v1.4",value:20243,memoryMB:80,highlight:!0},{label:"Deno",sub:"v2.9.5",value:10406,memoryMB:181},{label:"Node.js",sub:"v26.7.0",value:1e4,memoryMB:168}]},{id:"websocket-chat",title:"Running a WebSocket chat server",subtitle:"32 closed-loop clients broadcasting, delivery confirmed per message · ws 8.21.3 on Node.js · Linux x64, EPYC 9R14 · medians of 3",unit:"msg/s",dir:"higher",headline:"more messages/sec",vsLabel:"ws (Node.js)",href:"https://github.com/oven-sh/bun/tree/main/bench/websocket-server",rows:[{label:"Bun (publish)",sub:"v1.4",value:4170027,memoryMB:51,highlight:!0},{label:"Bun (send)",sub:"v1.4",value:159379,memoryMB:37},{label:"Deno",sub:"v2.9.5",value:124088,memoryMB:1234},{label:"ws (Node.js)",sub:"v26.7.0",value:123486,memoryMB:78}]}],install:{app:"T3-stack Next.js app, 25 direct dependencies, ~220 packages in the lockfile",method:"Linux x64, EPYC 9R14 · bench/install in oven-sh/bun · each package manager with its own lockfile and node_modules, state prepared per scenario before every run, every package manager at defaults · medians of 3, peak memory is the largest of the 3 runs",href:"https://github.com/oven-sh/bun/tree/main/bench/install",pms:[{key:"bun",label:"bun install",version:"v1.4"},{key:"npm",label:"npm install",version:"v12.0.2"},{key:"pnpm",label:"pnpm install",version:"v11.21.0"},{key:"yarn",label:"yarn install",version:"v1.22.22"}],scenarios:[{key:"clean",name:"First install, ever",when:"no cache · no lockfile · no node_modules",ms:{bun:1411,npm:18116,pnpm:13494,yarn:20513},mem:{bun:376,npm:503,pnpm:1851,yarn:498}},{key:"cache",name:"Fresh checkout, warm cache",when:"no lockfile yet · every package already in the cache",ms:{bun:251,npm:7612,pnpm:2375,yarn:1830},mem:{bun:52,npm:798,pnpm:1079,yarn:204}},{key:"ci-cold",name:"CI without a cache",when:"lockfile committed · every tarball fetched from the registry",ms:{bun:951,npm:4924,pnpm:11693,yarn:17609},mem:{bun:214,npm:455,pnpm:2767,yarn:323}},{key:"ci-cache",name:"CI with a warm cache",when:"lockfile committed · dependency cache restored · node_modules rebuilt",ms:{bun:210,npm:4449,pnpm:1920,yarn:1762},mem:{bun:12,npm:698,pnpm:1431,yarn:205}},{key:"nm",name:"node_modules there, cache gone",when:"already installed · only the dependency cache was cleared",ms:{bun:12,npm:384,pnpm:399,yarn:212},mem:{bun:12,npm:129,pnpm:141,yarn:107}},{key:"uptodate",name:"Everything already up to date",when:"the reinstall after nothing changed",ms:{bun:12,npm:337,pnpm:400,yarn:211},mem:{bun:12,npm:114,pnpm:141,yarn:107}}]}};
1var me=["install","react","sqlite","websocket"],ce=[{key:"install",label:"bun install"},{key:"bundler",label:"Bundler"},{key:"react",label:"Express"},{key:"sqlite",label:"Postgres"},{key:"websocket",label:"WebSockets"},{key:"test",label:"bun test"}],H=new Intl.NumberFormat("en-US"),pe=(m)=>m>=1000?`${(m/1024).toFixed(1)} GB`:`${m} MB`,V={"install-nextjs":{key:"install",subheading:"warm cache · seconds (lower is better)",primaryLabel:"install time",primaryUnit:"s",showMem:!1,claim:"faster installs than npm",fact:"Next.js app, warm cache"},"express-https":{key:"react",subheading:"hello-world app · requests per second (higher is better)",primaryLabel:"requests/sec",primaryUnit:"req/s",showMem:!0,claim:"the Express req/s of Node",fact:"Express over HTTPS"},"postgres-queries":{key:"sqlite",subheading:"100 rows à 100 queries in flight · queries per second (higher is better)",primaryLabel:"queries/sec",primaryUnit:"queries/s",showMem:!0,claim:"the Postgres queries/s of Node",fact:"Postgres queries"},"websocket-chat":{key:"websocket",subheading:"32 clients broadcasting · messages per second (higher is better)",primaryLabel:"messages/sec",primaryUnit:"msgs/s",showMem:!0,claim:"the WebSocket msgs/s of Node",fact:"WebSocket broadcast"}};function de(m){let p=V[m.id];if(!p)throw Error(`HeroBench: no copy for bench panel "${m.id}"`);let w=m.dir==="lower"&&m.unit==="s";return{key:p.key,heading:m.title,subheading:p.subheading,footnote:m.subtitle,primaryLabel:p.primaryLabel,primaryDir:m.dir,primaryUnit:p.primaryUnit,showMem:p.showMem&&m.rows.every((u)=>typeof u.memoryMB==="number"),rows:m.rows.map((u)=>({name:u.label,version:u.sub,primary:w?Math.round(u.value*1000):u.value,memoryLabel:typeof u.memoryMB==="number"?pe(u.memoryMB):"",bun:u.label.toLowerCase().startsWith("bun"),secondary:u.label.toLowerCase().startsWith("bun")&&!u.highlight?!0:void 0})),baseline:m.vsLabel,claim:p.claim,fact:p.fact,href:m.href}}var Q={...Object.fromEntries(U.panels.map((m)=>[V[m.id]?.key,de(m)])),bundler:{key:"bundler",heading:"Bundling 10 copies of three.js",subheading:"with sourcemaps and minification · milliseconds (lower is better)",footnote:"Linux x64 · bench/bundle in oven-sh/bun",primaryLabel:"bundle time",primaryDir:"lower",primaryUnit:"ms",showMem:!1,rows:[{name:"Bun",version:"v1.3.0",primary:269.1,memoryLabel:"",bun:!0},{name:"Rolldown",version:"v1.0.0-beta.42",primary:494.9,memoryLabel:""},{name:"esbuild",version:"v0.25.10",primary:571.9,memoryLabel:""},{name:"Farm",version:"v1.0.5",primary:1608,memoryLabel:""},{name:"Rspack",version:"v1.5.8",primary:2137,memoryLabel:""}],baseline:"esbuild",claim:"faster than esbuild",fact:"three.js Ã10, minified",href:"https://github.com/oven-sh/bun/tree/main/bench/bundle"},test:{key:"test",heading:"Making the rest look like test walkers",subheading:"the Zod test suite · seconds (lower is better)",footnote:"same tests, same machine · Jest configured with each transformer's defaults",primaryLabel:"wall time",primaryDir:"lower",primaryUnit:"s",showMem:!1,rows:[{name:"bun test",version:"",primary:230,memoryLabel:"",bun:!0},{name:"Vitest",version:"",primary:1914,memoryLabel:""},{name:"Jest + SWC",version:"",primary:3066,memoryLabel:""},{name:"Jest + ts-jest",version:"",primary:6712,memoryLabel:""},{name:"Jest + Babel",version:"",primary:7432,memoryLabel:""}],baseline:"Jest + Babel",claim:"faster tests than Jest",fact:"the Zod test suite",href:"https://github.com/oven-sh/bun/tree/main/bench"}};var Z=(m)=>`${(m/1000).toFixed(2)}s`,ue=(m)=>m>=1e6?`${(m/1e6).toFixed(2)}M`:m>=1e5?`${Math.round(m/1000)}K`:H.format(m);function be({panel:m}){return t("table",{className:"visually-hidden",children:[e("caption",{children:`${m.heading} â ${m.footnote}`}),e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"runtime"}),e("th",{scope:"col",children:"version"}),e("th",{scope:"col",children:m.primaryLabel}),e("th",{scope:"col",children:"peak RAM"})]})}),e("tbody",{children:m.rows.map((p)=>t("tr",{children:[e("th",{scope:"row",children:p.name}),e("td",{children:p.version}),e("td",{children:`${H.format(p.primary)} ${m.primaryUnit}`}),e("td",{children:p.memoryLabel})]},p.name))})]})}function he({panel:m,animateKey:p,race:g}){let w=m.primaryDir==="lower",u=Math.max(...m.rows.map((y)=>y.primary)),N=w?m.primaryUnit==="ms"?Math.ceil(u/500)*500:Math.ceil(u/1000)*1000:u/0.88,B=m.rows.some((y)=>y.primary>=1e6),f=w&&m.primaryUnit==="ms",L=(y)=>w?f?`${Math.round(y)}ms`:Z(y):B?ue(y):H.format(y),h=g!==null&&w;return t("div",{className:"flex flex-col gap-3",children:[m.showMem?t("div",{className:"label -mb-1 flex items-center gap-3 text-[9.5px] text-fg-faint","aria-hidden":!0,
1children:[e("div",{className:"w-[4.75rem] shrink-0 sm:w-[7rem]"}),e("div",{className:"min-w-0 flex-1"}),e("div",{className:"w-[3.9rem] shrink-0 text-right sm:w-[5rem]",children:m.primaryUnit}),e("div",{className:"w-[3.4rem] shrink-0 whitespace-nowrap text-right sm:w-[4.5rem]",children:"peak RAM"})]}):null,m.rows.map((y,C)=>{let R=y.bun&&!y.secondary,E=h?Math.min(g,y.primary):y.primary,P=!h||g>=y.primary,q=Math.max(E/N*100,h?0.8:2.5);return t("div",{className:"flex items-center gap-3",children:[t("div",{className:"w-[4.75rem] shrink-0 leading-tight sm:w-[7rem]",children:[e("div",{className:n("truncate text-[14px]",y.bun?"font-bold text-fg":"text-fg-muted"),children:y.name}),e("div",{className:"readout truncate text-[10px] text-fg-faint",children:y.version})]}),t("div",{className:"relative h-7 min-w-0 flex-1 bg-subtle",children:[e("div",{className:n("absolute inset-y-0 left-0",!h&&p>0&&"bar-grow",R?"bg-accent":y.secondary?"bg-accent/45":"bg-bar"),style:{width:`${q}%`,["--bar-delay"]:`${C*70}ms`}},`${p}-${y.name}`),R?e("span",{className:"absolute top-1/2 -translate-y-1/2",style:{left:`calc(${q}% + 6px)`},"aria-hidden":!0,children:e("img",{src:"/logo.svg",alt:"",className:n("block h-8 w-8",h&&P&&"animate-[hop_.6s_var(--ease-out)_1]")})}):null,h&&!P&&!R?e("span",{className:"absolute top-1/2 -translate-y-1/2 pl-2 text-[11px] text-fg-faint",style:{left:`${q}%`},children:"still goingâ¦"}):null]}),e("div",{className:n("readout w-[3.9rem] shrink-0 whitespace-nowrap text-right sm:w-[5rem]",R?"text-[1rem] font-bold text-fg sm:text-[1.15rem]":"text-[12px] text-fg-muted sm:text-[13px]",h&&!P&&"text-fg-faint"),children:L(E)}),m.showMem?e("div",{className:n("readout w-[3.4rem] shrink-0 whitespace-nowrap text-right text-[11px] sm:w-[4.5rem] sm:text-[12px]",R?"text-fg":"text-fg-muted"),children:y.memoryLabel}):null]},y.name)}),w?e(fe,{max:N,ms:m.primaryUnit==="ms"}):null]})}function fe({max:m,ms:p}){let g=p?1:1000,w=p?[100,250,500,1000]:[1,2,5,10],u=w.find((f)=>m/g/f<=6)??w[w.length-1],N=Math.floor(m/g/u),B=Array.from({length:N+1},(f,L)=>L*u);return t("div",{className:"relative ml-[5.5rem] mr-[4.65rem] h-6 sm:ml-[7.75rem] sm:mr-[5.75rem]","aria-hidden":!0,children:[e("div",{className:"absolute inset-x-0 top-0 border-t border-fg/40"}),B.map((f,L)=>t("span",{className:"absolute top-0 flex -translate-x-1/2 flex-col items-center",style:{left:`${f*g/m*100}%`},children:[e("span",{className:"h-1.5 w-px bg-fg/60"}),e("span",{className:n("readout mt-0.5 whitespace-nowrap text-[9.5px] text-fg-faint",L%2===1&&B.length>4&&"max-sm:hidden"),children:p?f===0?"0":f>=1000?`${f/1000}s`:`${f}ms`:`${f}s`})]},f))]})}function te({className:m,variant:p="card",tabs:g}){let u=(g??me).map((d)=>ce.find((b)=>b.key===d)).filter(Boolean),[N,B]=s(u[0].key),[f,L]=s(0),[h,y]=s(null),C=r(0),R=r([]),E=()=>{cancelAnimationFrame(C.current),y(null)},P=(d)=>{cancelAnimationFrame(C.current);let b=Math.max(...d.rows.map((A)=>A.primary)),k=performance.now(),T=()=>{let A=performance.now()-k;if(y(Math.min(A,b)),A<b)C.current=requestAnimationFrame(T)};y(0),C.current=requestAnimationFrame(T)};a(()=>()=>cancelAnimationFrame(C.current),[]);let[q,re]=s(u[0].key),[ie,W]=s(!1),Y=r(null),J=r({}),K=r();a(()=>()=>clearTimeout(K.current),[]);let F=(d)=>{if(d===N)return;E(),B(d),W(!0),clearTimeout(K.current);let b=Y.current;if(b)b.style.height=`${b.offsetHeight}px`;K.current=setTimeout(()=>{re(d),W(!1),L((k)=>k+1),requestAnimationFrame(()=>{let k=J.current[d];if(b&&k)b.style.height=`${k.offsetHeight}px`})},140)},oe=(d)=>{if(d.propertyName==="height"&&d.target===d.currentTarget)d.currentTarget.style.height=""},G=(d)=>{let b=u.findIndex((k)=>k.key===N);if(d.key==="ArrowRight"||d.key==="ArrowDown")b=(b+1)%u.length;else if(d.key==="ArrowLeft"||d.key==="ArrowUp")b=(b+u.length-1)%u.length;else if(d.key==="Home")b=0;else if(d.key==="End")b=u.length-1;else return;d.preventDefault(),F(u[b].key),R.current[b]?.focus()},I=p==="board";return t("div",{className:n("w-full overflow-hidden bg-canvas",I?"":"border border-rule",m),children:[u.length<2?null:I?e(Ue,{className:n("border-l border-t border-rule [&>div]:grid [&>div]:overflow-visible",u.length<=4?"[&>div]:grid-cols-[repeat(4,auto)]":"[&>div]:grid-cols-3 sm:[&>div]:grid-cols-6"),role:"tablist",ariaLabel:"Benchmarks",onKeyDown:G,children:u.map((d,b)=>{let k=d.key===N,T=Q[d.key];return e("button",{ref:(A)=>{R.current[b]=A},id:`tab-${d.key}`,"aria-controls":`${d.key}-tab-content`,role:"tab","aria-selected":k,tabIndex:k?0:-1,onClick:()=>F(d.key),className:n("group/tile relative flex min-w-0 items-center justify-center border-b border-r border-rule px-1.5 py-3 sm:px-2.5",k?"bg-slab text-slab-fg":"text-fg hover:bg-subtle"),children:e("span",{className:"whitespace-nowrap text-[12.5px] font-semibold sm:text-[13px]",children:d.label})},d.key)})}):e("div",{className:"flex items-stretch border-b border-rule",role:"tablist","aria-label":"Benchmarks",onKeyDown:G,children:u.map((d,b)=>{let k=d.key===N;return e("button",{ref:(T)=>{R.current[b]=T},id:`tab-${d.key}`,"aria-controls":`${d.key}-tab-content`,role:"tab","aria-selected":k,tabIndex:k?0:-1,onClick:()=>F(d.key),className:n("label relative flex-1 whitespace-nowrap border-r border-rule px-1.5 py-2.5 text-center text-[10.5px] last:border-r-0",k?"bg-slab text-slab-fg":"text-fg-muted hover:bg-subtle hover:text-fg"),children:d.label},d.key)})}),e("div",{ref:Y,onTransitionEnd:oe,className:n("overflow-hidden transition-[height] duration-[380ms] ease-[cubic-bezier(.2,.9,.25,1)]",I&&"border-x border-b border-rule",u.length<2&&"border-t"),children:u.map((d)=>{let b=Q[d.key],k=d.key===q;return t("div",{ref:(T)=>{J.current[d.key]=T},role:"tabpanel",id:`${b.key}-tab-content`,"aria-labelledby":`tab-${b.key}`,hidden:!k,className:n("panel text-left",k&&(ie?"panel-out":f>0&&"panel-in")),children:[t("div",{className:"flex items-start justify-between gap-3 px-5 pb-2 pt-5 sm:px-6",children:[t("div",{className:"min-w-0",children:[e("h2",{className:"m-0 text-[1.05rem] font-bold tracking-[-0.01em] text-fg",children:b.heading}),e("p",{className:"m-0 mt-0.5 text-[13px] leading-snug text-fg-muted",children:b.subheading})]}),b.primaryDir==="lower"?e("button",{type:"button",onClick:()=>h!==null&&h<Math.max(...b.rows.map((T)=>T.primary))?E():P(b),className:"group/race inline-flex shrink-0 items-center gap-1.5 text-[12.5px] text-fg-muted hover:text-fg","aria-label":"Replay this benchmark in real time",title:"Watch it at real speed",children:h!==null&&h<Math.max(...b.rows.map((T)=>T.primary))?t(o,{children:[e("span",{className:"h-1.5 w-1.5 rounded-[1px] bg-accent","aria-hidden":!0})," ",Z(h)]}):t(o,{children:[e("svg",{viewBox:"0 0 12 12",className:"h-2.5 w-2.5 text-accent transition-transform group-hover/race:scale-110",fill:"currentColor","aria-hidden":!0,
1children:e("path",{d:"M2.5 1.6v8.8c0 .5.5.8.9.5l7-4.4a.6.6 0 000-1L3.4 1.1c-.4-.3-.9 0-.9.5z"})}),e("span",{className:"hidden sm:inline",children:"replay in real time"}),e("span",{className:"sm:hidden",children:"real time"})]})}):null]}),e("div",{className:"px-5 pt-3 sm:px-6",children:e(he,{panel:b,animateKey:f,race:k?h:null})}),t("div",{className:"px-5 pb-4 pt-4 sm:px-6",children:[t("div",{className:"flex items-start justify-between gap-3 border-t border-rule/40 pt-3 text-[11.5px] leading-snug text-fg-faint",children:[e("span",{className:"min-w-0",children:b.footnote}),e("a",{href:b.href,className:"shrink-0 text-fg-muted underline underline-offset-[3px] hover:text-fg",target:"_blank",rel:"noopener",children:"reproduce"})]}),e(be,{panel:b})]})]},d.key)})})]})}i();var S={posix:{label:"macOS & Linux",prompt:"$",command:"curl -fsSL https://bun.sh/install | bash",script:"https://bun.sh/install"},windows:{label:"Windows",prompt:">",command:'powershell -c "irm bun.sh/install.ps1|iex"',script:"https://bun.sh/install.ps1"}};function ne({className:m,size:p="lg",invert:g}){let[w,u]=s("posix");a(()=>
1{if(/Win/i.test(navigator.platform))u("windows");delete document.documentElement.dataset.os},[]);let N=S[w],[B,f]=s(0),L=[[-46,-38,200],[38,-44,120],[-20,-62,300],[54,-12,60],[-58,8,240],[24,40,20],[-30,46,150],[62,30,330],[4,-70,90],[-66,-16,270]];return t("div",{className:n("relative w-full max-w-[36rem]",m),onClickCapture:(h)=>h.target.closest(".CopyIcon")&&f((y)=>y+1),children:[B?t("div",{className:"bubble-in pointer-events-none absolute -top-5 right-2 z-20 flex -translate-y-full items-center gap-2","aria-live":"polite",children:[e("span",{className:"bg-accent px-3 py-2 text-[13px] font-semibold text-white ring-2 ring-canvas",children:"Copied â now paste it in a terminal âµ"}),e("img",{src:"/logo.svg",alt:"",className:"h-9 w-9 animate-[hop_.6s_var(--ease-out)_1]"})]},B):null,Object.keys(S).map((h)=>t("div",{"data-install":h,hidden:h!==w,className:n("group/cmd cut relative flex items-stretch [--cut:12px]",g?"bg-canvas text-fg":"bg-slab text-slab-fg",p==="lg"?"h-[60px]":"h-12",h!==w&&"hidden"),children:[e("span",{className:"readout flex select-none items-center pl-5 pr-3 text-accent","aria-hidden":!0,children:S[h].prompt}),e("code",{className:n("readout scroll-none flex min-w-0 flex-1 items-center overflow-x-auto whitespace-nowrap",p==="lg"?"text-[15px]":"text-[13.5px]"),children:S[h].command}),e(O,{text:S[h].command,label:"Copy install command",className:n("h-full w-14 rounded-none border-l hover:bg-accent hover:text-white",g?"border-rule/40 text-fg/70":"border-canvas/20 text-canvas/70")})]},h)),t("div",{className:"mt-2.5 flex items-center justify-between gap-3",children:[e("div",{role:"tablist","aria-label":"Operating system",className:n("inline-flex border p-px text-[12px]",g?"border-canvas/40":"border-rule/60"),children:Object.keys(S).map((h)=>e("button",{type:"button",role:"tab","aria-selected":h===w,"data-install-link":h,onClick:()=>u(h),className:n("px-2.5 py-[3px]",h===w?g?"bg-canvas text-fg":"bg-slab text-slab-fg":g?"text-canvas/70 hover:text-canvas":"text-fg-muted hover:text-fg"),children:S[h].label},h))}),e("a",{href:N.script,className:n("text-[12.5px]",g?"text-canvas/60 hover:text-canvas":"text-fg-faint hover:text-fg"),target:"_blank",rel:"noopener",children:"View install script â"})]})]})}var ye=[{title:"Reads your project as-is",items:[{name:"package.json",hint:"scripts, bin, exports",href:"/docs/pm/cli/install"},{name:"Migrates your lockfile",hint:"package-lock · yarn.lock · pnpm-lock",href:"/docs/pm/lockfile"},{name:".npmrc",hint:"registries, auth tokens, scopes",href:"/docs/pm/npmrc"},{name:"Workspaces",hint:"monorepos, filters, hoisting",href:"/docs/pm/workspaces"},{name:"Private registries",hint:"scoped registries + auth",href:"/docs/pm/registries"}]},{title:"Everything you rely on",items:[{name:"overrides & resolutions",hint:"npm and yarn formats",href:"/docs/pm/overrides"},{name:"Patched dependencies",hint:"bun patch, no extra tooling",href:"/docs/pm/patch"},{name:"git · GitHub · tarball · file",hint:"every dependency source",href:"/docs/pm/cli/add"},{name:"Lifecycle scripts",hint:"postinstall via trustedDependencies",href:"/docs/pm/lifecycle"},{name:"Isolated or hoisted",hint:"pnpm-style or classic node_modules",href:"/docs/pm/isolated-installs"},{name:"Catalogs",hint:"one version across workspaces",href:"/docs/pm/catalogs"}]},{title:"The whole toolbelt",items:[{name:"bun.lock",hint:"readable, mergeable text lockfile",href:"/docs/pm/lockfile"},{name:"bun outdated · update -i",hint:"interactive upgrades",href:"/docs/pm/cli/outdated"},{name:"bun why · audit · info",hint:"understand your tree",href:"/docs/pm/cli/why"},{name:"bun publish · pm pack",hint:"ship packages",href:"/docs/pm/cli/publish"},{name:"bunx",hint:"run any package binary, instantly",href:"/docs/pm/bunx"},{name:"--frozen-lockfile",hint:"reproducible CI installs",href:"/docs/pm/cli/install"}]}],{install:D}=U,X=D.scenarios.map((m)=>({key:m.key,scenario:m.name,when:m.when,...m.ms})),ee=Object.fromEntries(D.scenarios.map((m)=>[m.key,m.mem])),ae=(m)=>m>=1000?`${(m/1024).toFixed(1)} GB`:`${m} MB`,j=(m)=>m>=1000?`${(m/1000).toFixed(2)}s`:`${m}ms`;function ge({r:m,className:p}){let g=[{key:"bun",label:"bun",ms:m.bun},{key:"npm",label:"npm",ms:m.npm},{key:"pnpm",label:"pnpm",ms:m.pnpm},{key:"yarn",label:"yarn",ms:m.yarn}],w=Math.max(...g.map((f)=>f.ms)),u=g.slice(1),N=Math.round(Math.min(...u.map((f)=>f.ms))/m.bun),B=Math.round(Math.max(...u.map((f)=>f.ms))/m.bun);return t(M,{className:n("p-5",p),children:[t("div",{className:"mb-4",children:[e("div",{className:"text-[15px] font-semibold leading-tight text-fg",children:m.scenario}),e("div",{className:"mt-1 text-[12.5px] text-fg-faint",children:m.when})]}),e("div",{className:"flex flex-col gap-2.5",children:g.map((f)=>{let L=f.key==="bun",h=Math.max(f.ms/w*100,L?6:3);return t("div",{className:"flex items-center gap-2.5",children:[e("div",{className:n("w-9 shrink-0 text-[12.5px]",L?"font-semibold text-fg":"text-fg-muted"),children:f.label}),t("div",{className:"relative h-3.5 flex-1 border-b border-rule/50",children:[e("div",{className:n("absolute inset-y-0 left-0",L?"bg-accent":"bg-bar"),style:{width:`${h}%`}}
1),L&&e("img",{src:"/logo.svg",alt:"","aria-hidden":!0,className:"absolute -top-2.5 h-8 w-8 drop-",style:{left:`calc(${h}% - 6px)`}})]}),e("div",{className:n("mono w-14 shrink-0 whitespace-nowrap text-right tabular-nums",L?"text-[15px] font-bold text-fg":"text-[12.5px] text-fg-muted"),children:j(f.ms)})]},f.key)})}),t("div",{className:"mono mt-4 flex items-center justify-between border-t border-line pt-2.5 text-[11px] text-fg-faint",children:[e("span",{className:"text-accent-strong",children:N===B?`${N}Ã faster`:`${N}â${B}Ã faster`}),t("span",{className:"tabular-nums",children:["RAM ",ae(ee[m.key].bun)," vs pnpm ",ae(ee[m.key].pnpm)]})]})]})}function se({compact:m}){return e("section",{className:"border-t border-rule py-16 md:py-28",children:t(c,{children:[t(x,{className:"flex flex-col items-start justify-between gap-6 md:flex-row md:items-end",children:[e(_,{align:"left",eyebrow:"bun install",title:"The fastest install in every situation you actually hit.",body:`Cold cache, warm cache, CI, a no-op reinstall â one ${D.app}, measured six ways against npm, pnpm and yarn at their defaults.`}),t("div",{className:"flex shrink-0 gap-3",children:[e(v,{href:"/package-manager",arrow:!0,children:"bun install"}),e(v,{href:"/guides/install/from-npm-install-to-bun-install",variant:"secondary",children:"Migrate from npm"})]})]}),m?null:e(x,{className:"mt-14 grid gap-10 md:grid-cols-3",children:ye.map((p)=>t("div",{children:[e("h3",{className:"label",children:p.title}),e("ul",{className:"mt-4 flex flex-col gap-2.5",children:p.items.map((g)=>e("li",{children:t(l,{href:g.href,className:"group/cap flex items-start gap-2.5",children:[e(z,{className:"mt-[5px] h-3.5 w-3.5 shrink-0 text-accent"}),t("span",{className:"leading-snug",children:[e("span",{className:"text-[14.5px] text-fg underline decoration-transparent underline-offset-4 transition-colors group-hover/cap:decoration-line-strong",children:g.name}),e("span",{className:"ml-2 text-[13px] text-fg-faint",children:g.hint})]})]})},g.name))})]},p.title))}),e(x,{className:"-mx-gutter mt-12 flex snap-x snap-mandatory gap-4 overflow-x-auto px-gutter pb-2 scroll-none sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 lg:grid-cols-3",children:X.map((p)=>e(ge,{r:p,className:"w-[82vw] shrink-0 snap-center sm:w-auto"},p.key))}),t("p",{className:"mt-4 flex flex-wrap justify-between gap-3 text-[12px] text-fg-faint",children:[e("span",{children:D.method}),e("a",{href:D.href,className:"hover:text-fg",target:"_blank",rel:"noopener",children:"reproduce the benchmark â"})]}),t("table",{className:"visually-hidden",children:[e("caption",{children:"bun install vs npm, pnpm and yarn â install time by scenario (medians of 3, Linux x64)"}),e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"scenario"}),e("th",{scope:"col",children:"bun"}),e("th",{scope:"col",children:"npm"}),e("th",{scope:"col",children:"pnpm"}),e("th",{scope:"col",children:"yarn"})]})}),e("tbody",{children:X.map((p)=>t("tr",{children:[e("th",{scope:"row",children:`${p.scenario} (${p.when})`}),e("td",{children:j(p.bun)}),e("td",{children:j(p.npm)}),e("td",{children:j(p.pnpm)}),e("td",{children:j(p.yarn)})]},p.scenario))})]})]})})} 2export{U,te,ne,se};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.