-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git: Add support for sparse checkout #685
Comments
Did you try https://github.com/zephyrproject-rtos/west/issues?q=label%3Aperformance+ EDIT: also take a look at: Refs |
I haven't tried but looked at the docs,
|
Bummer. I was curious so I took at quick look at what this would take. This would be tricky because the sparse-checkout configuration is git repo specific and should happen between
How much time saved? As with every other performance problem, you don't know until you have measured it. And then you only know for the particular cases you measured. According to https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/ saves significant time only for large "monorepos". Is that your case? #319 has some measurements. Please take a look at it and see how much other optimizations that are already available can help. BTW: https://git-scm.com/docs/git-sparse-checkout
For measuring/testing/prototyping here's a starting point: --- a/src/west/app/project.py
+++ b/src/west/app/project.py
@@ -1228,7 +1228,7 @@ class Update(_ProjectCommand):
# out the new detached HEAD, then print some helpful context.
if take_stats:
start = perf_counter()
- project.git(['checkout', '--detach', sha])
+ # project.git(['checkout', '--detach', sha])
if take_stats:
stats['checkout new manifest-rev'] = perf_counter() - start
self.post_checkout_help(project, current_branch,
@@ -1505,7 +1505,7 @@ class Update(_ProjectCommand):
# it avoids a spammy detached HEAD warning from Git.
if take_stats:
start = perf_counter()
- project.git('checkout --detach ' + QUAL_MANIFEST_REV)
+ project.git('update-ref HEAD ' + QUAL_MANIFEST_REV)
if take_stats:
stats['checkout new manifest-rev'] = perf_counter() - start This (tested) HACK stops |
Newcomer comment: I started going through the "Getting started" today (Windows 10 + WSL2) and this step takes ages. I am expecting only the latest state of Zephyr repo would be required, but it looks like a deep clone.
There are likely two separate concerns: getting people onboarded fast (not happening to me, at least; the clone is still ongoing...) and the Edit: There was something wrong with my WLAN. Was able to raise the 176 KiB/s to ~2 Mbps but that's missing the point. Still time-and-space taking, to get started.. 1h gone |
With some simple optimizations, the SOF CI clones the zephyr repo and a few others from scratch for every SOF PR in in 40s: https://github.com/thesofproject/sof/actions/workflows/daily-tests.yml
There are many different optimizations possible and many are not mutually exclusive. Here's a tentative list: None is perfect which is why none is enabled by default.
2Mb/s does not qualify as "broadband". Without any optimization, cloning everything from scratch typically takes 5 minutes max for me. |
When west is used to pull in dependent files, currently we need to do a full repo clone, this is unnecessary and slow. If we can add git's sparse checkout feature we can extend
west.yml
to take a list of files/folders with regex and only checkout those saving time and bandwidth.E.g., Manifest project A, wants a specific shared header file in project B and nothing else.
The text was updated successfully, but these errors were encountered: