Skip to content

Implement a HttpClient that can do multiple downloads in parallel - #3464

Merged
Databean merged 3 commits into
google:mainfrom
Databean:curl_parallel
Oct 30, 2026
Merged

Databean merged 3 commits into
google:mainfrom
Databean:curl_parallel

Conversation

@Databean

@Databean Databean commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

This will allow implementing more parallelism in cvd fetch.

Behavioral difference on my machine, running

time bazel run //cuttlefish/package:cvd -c opt -- fetch \
  --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug \
  --target_directory=$HOME/dl \
  --enable_caching=false

Without pool, 5 runs:

  • 15.24s user 11.90s system 66% cpu 40.926 total
  • 14.85s user 11.96s system 69% cpu 38.312 total
  • 15.10s user 12.24s system 69% cpu 39.434 total
  • 14.94s user 12.08s system 70% cpu 38.171 total
  • 15.58s user 12.09s system 69% cpu 40.081 total

With pool, 5 runs:

  • 15.31s user 14.47s system 79% cpu 37.281 total
  • 15.39s user 12.45s system 74% cpu 37.200 total
  • 14.82s user 12.66s system 76% cpu 35.918 total
  • 14.98s user 12.98s system 77% cpu 36.279 total
  • 14.94s user 13.37s system 75% cpu 37.521 total

Right now, most of the invocations of HttpClient happen synchronously, except for the cvd-host_package.tar.gz download, which is always invoked on a separate thread.

Bug: b/579555638

@Databean
Databean requested a review from jemoreira October 29, 2026 23:06
@Databean Databean changed the title Curl parallel Implement a HttpClient that can do multiple downloads in parallel Oct 29, 2026
@Databean Databean added the kokoro:run Run e2e tests. label Oct 30, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Oct 30, 2026
@Databean Databean added the kokoro:run Run e2e tests. label Oct 30, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Oct 30, 2026
Delegate HttpClient implementations are created dynamically up to a
limit.

Bug: b/579555638
Behavioral difference on my machine, running
```
time bazel run //cuttlefish/package:cvd -c opt -- fetch \
  --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug \
  --target_directory=$HOME/dl \
  --enable_caching=false
```

Without pool, 5 runs:

- 15.24s user 11.90s system 66% cpu 40.926 total
- 14.85s user 11.96s system 69% cpu 38.312 total
- 15.10s user 12.24s system 69% cpu 39.434 total
- 14.94s user 12.08s system 70% cpu 38.171 total
- 15.58s user 12.09s system 69% cpu 40.081 total

With pool, 5 runs:

- 15.31s user 14.47s system 79% cpu 37.281 total
- 15.39s user 12.45s system 74% cpu 37.200 total
- 14.82s user 12.66s system 76% cpu 35.918 total
- 14.98s user 12.98s system 77% cpu 36.279 total
- 14.94s user 13.37s system 75% cpu 37.521 total

Right now, most of the invocations of `HttpClient` happen synchronously,
except for the cvd-host_package.tar.gz download, which is always invoked
on a separate thread.

Bug: b/579555638
@Databean Databean added the kokoro:run Run e2e tests. label Oct 30, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Oct 30, 2026
@Databean
Databean added this pull request to the merge queue Oct 30, 2026
Merged via the queue into google:main with commit 4f8fe6e Oct 30, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants