turbo
634dad8a - perf(create-turbo): Download files faster (#11297)

Commit
11 days ago
perf(create-turbo): Download files faster (#11297) ### Description I was becoming a little annoyed that `create-turbo` takes _so long_ to download files. Even while I'm on a strong internet connection, it would take something like 10 seconds. Additionally, situations like https://github.com/vercel/turborepo/issues/10456 were coming up because getting the example onto the machine is so slow. It appears to be hanging when its really just unexpectedly slow. With some investigation, I found out that `create-turbo` was downloading, **the entirety of `vercel/turborepo`** just to get the code for an example. It turns out that this is a deficiency in GitHub's API; you can't download subdirectories from a repo. Instead, we can do sparse checkouts without the lightest-weight git options that we can to improve performance as much as possible. ### Testing Instructions I'm hand-testing the binary and it's significantly faster. ``` ▲ 👟 ~/projects/debugs hyperfine \ -r 5 \ --prepare 'rm -rf ./benchies' \ --cleanup 'rm -rf ./benchies' \ -n 'Old' 'npx create-turbo ./benchies --skip-install --skip-transforms' \ -n 'New' 'node ~/projects/open/turbo/packages/create-turbo/dist/cli.js ./benchies --skip-install --skip-transforms' Benchmark 1: Old Time (mean ± σ): 37.377 s ± 3.938 s [User: 2.602 s, System: 1.044 s] Range (min … max): 31.170 s … 41.525 s 5 runs Benchmark 2: New Time (mean ± σ): 2.985 s ± 0.098 s [User: 0.659 s, System: 0.323 s] Range (min … max): 2.890 s … 3.107 s 5 runs Summary New ran 12.52 ± 1.38 times faster than Old ``` <sub>Closes https://github.com/vercel/turborepo/issues/10456</sub> <sub> Closes TURBO-5050</sub> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Author
Parents
Loading