Skip to content

perf: bypass try_join_all for single requirements - #289

Merged
baszalmstra merged 1 commit into
prefix-dev:mainfrom
baszalmstra:perf/single-requirement-join
Aug 27, 2026
Merged

perf: bypass try_join_all for single requirements#289
baszalmstra merged 1 commit into
prefix-dev:mainfrom
baszalmstra:perf/single-requirement-join

Conversation

@baszalmstra

@baszalmstra baszalmstra commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Most requirements refer to a single version set, but candidate fetching still wraps each one in try_join_all. That adds per-future bookkeeping to a very common path.

This handles Requirement::Single directly and keeps try_join_all for unions, so union members remain concurrent when provider futures yield. It also changes solve-snapshot's default per-solve timeout from 60 seconds to 10 seconds.

Performance

On 2,000 fixed-seed cases in four rotated slices against 902eafe:

Upstream main This PR
Total 673.7s 582.3s (-13.58%)
Median 256.2ms 220.7ms
p95 808.0ms 715.5ms
Max 3708.2ms 2171.8ms

The paired workloads and solve/unsat outcomes matched. A separate tracking-allocator check reduced allocation count by 26.19% and allocated bytes by 37.58%; peak live memory was unchanged.

Solve duration histogram

Per-problem duration difference

Testing

  • pixi run -e test-rust cargo fmt --check
  • pixi run -e test-rust cargo test --all-features

@baszalmstra
baszalmstra marked this pull request as ready for review August 26, 2026 15:28
@baszalmstra
baszalmstra enabled auto-merge (squash) August 26, 2026 15:29
@baszalmstra
baszalmstra force-pushed the perf/single-requirement-join branch from 879af5b to 31f4835 Compare August 27, 2026 07:31
Keep union candidate requests concurrent while avoiding try_join_all's per-future bookkeeping for the common single-version-set case. Also lower solve-snapshot's default per-solve timeout to 10 seconds.
@baszalmstra
baszalmstra force-pushed the perf/single-requirement-join branch from 31f4835 to ae52f7b Compare August 27, 2026 07:38
@baszalmstra
baszalmstra merged commit 5a0ca88 into prefix-dev:main Aug 27, 2026
9 checks passed
@octo-sts octo-sts Bot mentioned this pull request Aug 27, 2026
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.

1 participant