Skip to content

Introduce JobQueue and and use it to list files#394

Merged
Morriar merged 3 commits into
mainfrom
at-job-queue
Jan 6, 2026
Merged

Introduce JobQueue and and use it to list files#394
Morriar merged 3 commits into
mainfrom
at-job-queue

Conversation

@Morriar
Copy link
Copy Markdown
Contributor

@Morriar Morriar commented Dec 16, 2025

The queue is backed by crossbeam::{channel, deque, utils} and provides parallelism, communication through channels and job stealing with backoff.

In this PR we migrate the file listing to the JobQueue, I'll follow up with indexing and resolution.

Benchmarks:

# listing files from core

Branch                       Avg Time (s)  Avg MRSS (MB)
main                         0.842         16.3
ignore-crate                 0.364         23.7
job-queue                    0.306         23.8

# listing files from shop/world/

Branch                       Avg Time (s)  Avg MRSS (MB)
main                         8.776         21.3
ignore-crate                 1.791         33.5
job-queue                    1.517         36.2

Closes #100
Closes #205

@Morriar Morriar requested a review from a team as a code owner December 16, 2025 15:21
Copy link
Copy Markdown
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but still wanted to bring up: does rayon provide us with something like this by default?

I know it has many modes for running code in parallel, so I wonder if bringing rayon back is worth it.

Comment thread rust/saturn/src/job_queue.rs Outdated
Comment thread rust/saturn/src/main.rs Outdated
@Morriar Morriar force-pushed the at-job-queue branch 2 times, most recently from 029f550 to e3b8f73 Compare January 6, 2026 19:04
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Now that we handle aliases properly we should not fail if one couldn't be
resolved properly so instead of a `Result` we return a tuple.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar
Copy link
Copy Markdown
Contributor Author

Morriar commented Jan 6, 2026

I like this, but still wanted to bring up: does rayon provide us with something like this by default?

Yes to some extent.

I found that the main difference is the API we can expose. With the JobQueue the idea is to hide the complexity and just make people implement and push jobs. With Rayon the user of the queue has to handle lower level concept like spawning themselves.

In the end I went with the cleaner API to save ourselves some complexity in the usesites.

@Morriar Morriar enabled auto-merge January 6, 2026 19:23
@Morriar Morriar merged commit 313f657 into main Jan 6, 2026
14 checks passed
@Morriar Morriar deleted the at-job-queue branch January 6, 2026 19:24
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.

Experiment with channels and concurrent maps for parallel indexing

3 participants