Skip to content

Conversation

@snomos
Copy link
Member

@snomos snomos commented Oct 27, 2025

This PR implements parallel processing using Rayon to make commands significantly faster when running on multiple repositories simultaneously.

Critical commands (especially gut template apply --abort and gut topic get which were very slow)

  • gut template apply --abort
  • gut template apply --continue
  • gut template apply (start)
  • gut topic get

GitHub API commands

  • gut topic set
  • gut topic add
  • gut branch protect
  • gut branch unprotect
  • gut branch default
  • gut set secret
  • gut set info
  • gut set team permission
  • gut hook create
  • gut hook delete
  • gut workflow run

Git operations

  • gut checkout
  • gut topic apply

Already parallelized

  • gut status (already using rayon)
  • gut apply (already using rayon)

Changes

  • Changed sequential for loops to parallel .par_iter().for_each()
  • Added use rayon::prelude::*; to all relevant files
  • No functional changes - same logic, just parallel execution

Benefits

  • 🚀 Significant speed improvement when commands run on multiple repositories
  • 🔧 API calls and git operations now run in parallel
  • ✅ No breaking changes - same API and behavior

Rayon is already a dependency in the project, so this adds no new dependencies.

Build Instructions

Note: There is currently a known issue with OpenSSL building on macOS Sequoia (26.0) with Homebrew Perl 5.40. This error is not related to the changes in this PR.

Solution for building locally:

# Use system OpenSSL instead of vendored version
OPENSSL_NO_VENDOR=1 cargo build --release

Alternatively, set this in .cargo/config.toml:

[env]
OPENSSL_NO_VENDOR = "1"

The code is syntactically correct and has no errors. VS Code shows no issues, and cargo check with OPENSSL_NO_VENDOR=1 passes without errors.

Implementerer parallellprosessering med Rayon for følgjande kommandoar:

Kritiske kommandoar:
- gut template apply --abort
- gut template apply --continue
- gut template apply (start)
- gut topic get

GitHub API-kommandoar:
- gut topic set
- gut topic add
- gut branch protect
- gut branch unprotect
- gut branch default
- gut set secret
- gut set info
- gut set team permission
- gut hook create
- gut hook delete
- gut workflow run

Git-operasjonar:
- gut checkout
- gut topic apply

Endringane vil gi betydeleg hastigheitsauke når kommandoane køyrer på fleire repositories samtidig, sidan API-kall og git-operasjonar no kan køyrast parallelt i staden for sekvensielt.
@snomos snomos requested review from bbqsrc and dylanhand October 27, 2025 22:32
@snomos
Copy link
Member Author

snomos commented Oct 27, 2025

Build fails for me with the following error:

syswrite() isn't allowed on :utf8 handles at /opt/homebrew/opt/perl/lib/perl5/5.40/File/Copy.pm line 178.

A Perl module!! In a Rust depency!!

@snomos
Copy link
Member Author

snomos commented Oct 27, 2025

It is indeed true:

https://docs.rs/openssl/latest/openssl/#vendored

How mean can the world be...

@snomos
Copy link
Member Author

snomos commented Oct 27, 2025

Build Instructions

Note: There is currently a known issue with OpenSSL building on macOS Sequoia (26.0) with Homebrew Perl 5.40. This error is not related to the changes in this PR.

Solution for building locally:

# Use system OpenSSL instead of vendored version
OPENSSL_NO_VENDOR=1 cargo build --release

Alternatively, set this in .cargo/config.toml:

[env]
OPENSSL_NO_VENDOR = "1"

The code is syntactically correct and has no errors. VS Code shows no issues, and cargo check with OPENSSL_NO_VENDOR=1 passes without errors.

@snomos snomos changed the title Paralleliser 17 kommandoar for raskare køyring Parallelize 17 commands for faster execution Oct 28, 2025
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.

2 participants