Upgrade mea to asyncband - #2553
Conversation
- update cargo manifests and workspace dependencies - replace mea import paths with asyncband equivalents - update macports portfile checksums for the renamed crate Signed-off-by: mingcheng <mingcheng@apache.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2553 +/- ##
=======================================
Coverage 93.63% 93.63%
=======================================
Files 134 134
Lines 28842 28842
=======================================
Hits 27006 27006
Misses 1836 1836 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase to replace the mea crate with the renamed/replacement asyncband crate, updating dependency manifests, Rust import paths, and MacPorts vendored-crate checksums to keep builds consistent across packaging targets.
Changes:
- Swap workspace dependency from
meatoasyncband(includingCargo.lockregeneration). - Update Rust imports to use
asyncband::{once, semaphore}instead ofmea::{once, semaphore}. - Update the MacPorts
Portfilecrate list to includeasyncbandand dropmea.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/macports/Portfile | Adds asyncband crate checksum entry and removes mea to keep MacPorts vendoring in sync with Cargo deps. |
| crates/prek/src/languages/python/python.rs | Switches OnceMap import to asyncband::once::OnceMap. |
| crates/prek/src/languages/node/installer.rs | Switches OnceMap import to asyncband::once::OnceMap. |
| crates/prek/src/languages/haskell.rs | Switches OnceCell import to asyncband::once::OnceCell. |
| crates/prek/src/cli/run/run.rs | Switches Semaphore import to asyncband::semaphore::Semaphore. |
| crates/prek/src/cli/run/install.rs | Switches OnceCell/Semaphore imports to asyncband. |
| crates/prek/Cargo.toml | Replaces the mea dependency with asyncband at the crate level. |
| Cargo.toml | Replaces the workspace mea dependency with asyncband (version bump to 0.6.7). |
| Cargo.lock | Adds asyncband package entry and removes mea; updates prek dependency list accordingly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d9b123521
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
To provide more context, the You can find more details at https://cwiki.apache.org/confluence/spaces/INCUBATOR/pages/446071349/Asyncband+Proposal. With some helpful feedback we decided to rebrand |
📦 Cargo Bloat ComparisonBinary size change: +0.33% (30.3 MiB → 30.4 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
⚡️ Hyperfine BenchmarksSummary: 0 regressions, 0 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
2.3 ± 0.1 | 2.1 | 2.5 | 1.00 |
prek-head --version |
2.4 ± 0.2 | 2.1 | 3.4 | 1.05 ± 0.09 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.3 ± 0.2 | 9.0 | 10.8 | 1.00 |
prek-head list |
9.5 ± 0.3 | 9.0 | 10.4 | 1.02 ± 0.04 |
prek validate-config .pre-commit-config.yaml
⏭️ Skipped: .pre-commit-config.yaml not found
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.6 ± 0.1 | 2.5 | 2.8 | 1.00 ± 0.04 |
prek-head sample-config |
2.6 ± 0.1 | 2.5 | 2.7 | 1.00 |
Cold vs Warm Runs
Comparing first run (cold) vs subsequent runs (warm cache):
prek run --all-files (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
40.0 ± 1.4 | 37.5 | 42.4 | 1.00 |
prek-head run --all-files |
40.1 ± 1.3 | 38.6 | 42.4 | 1.00 ± 0.05 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
40.6 ± 0.9 | 38.5 | 42.8 | 1.01 ± 0.04 |
prek-head run --all-files |
40.4 ± 1.1 | 38.9 | 42.0 | 1.00 |
Full Hook Suite
Running the builtin hook suite on the benchmark workspace:
prek run --all-files (full builtin hook suite)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
40.9 ± 2.0 | 38.3 | 48.0 | 1.01 ± 0.06 |
prek-head run --all-files |
40.6 ± 1.1 | 38.6 | 43.5 | 1.00 |
Individual Hook Performance
Benchmarking each hook individually on the test repo:
prek run trailing-whitespace --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run trailing-whitespace --all-files |
13.8 ± 0.6 | 13.0 | 15.9 | 1.00 ± 0.06 |
prek-head run trailing-whitespace --all-files |
13.8 ± 0.5 | 12.9 | 14.9 | 1.00 |
prek run end-of-file-fixer --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run end-of-file-fixer --all-files |
11.5 ± 0.5 | 10.7 | 12.9 | 1.00 |
prek-head run end-of-file-fixer --all-files |
11.7 ± 0.4 | 10.8 | 12.6 | 1.01 ± 0.06 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
8.2 ± 0.3 | 7.7 | 8.7 | 1.01 ± 0.05 |
prek-head run check-json --all-files |
8.1 ± 0.3 | 7.6 | 8.9 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
7.9 ± 0.1 | 7.8 | 8.2 | 1.00 |
prek-head run check-yaml --all-files |
8.3 ± 0.3 | 7.8 | 8.9 | 1.04 ± 0.04 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
7.9 ± 0.3 | 7.3 | 8.4 | 1.02 ± 0.05 |
prek-head run check-toml --all-files |
7.7 ± 0.2 | 7.2 | 8.1 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
7.6 ± 0.3 | 7.3 | 8.6 | 1.00 ± 0.06 |
prek-head run check-xml --all-files |
7.6 ± 0.3 | 7.2 | 8.5 | 1.00 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
11.3 ± 0.6 | 10.4 | 13.3 | 1.00 |
prek-head run detect-private-key --all-files |
11.4 ± 0.7 | 10.3 | 13.6 | 1.00 ± 0.08 |
prek run fix-byte-order-marker --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run fix-byte-order-marker --all-files |
13.7 ± 1.1 | 12.2 | 17.3 | 1.04 ± 0.10 |
prek-head run fix-byte-order-marker --all-files |
13.3 ± 0.9 | 12.0 | 16.2 | 1.00 |
Installation Performance
Benchmarking hook installation (fast path hooks skip Python setup):
prek install-hooks (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.7 ± 0.1 | 4.6 | 4.8 | 1.01 ± 0.02 |
prek-head install-hooks |
4.6 ± 0.1 | 4.6 | 4.7 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.8 ± 0.1 | 4.7 | 5.0 | 1.02 ± 0.04 |
prek-head install-hooks |
4.7 ± 0.2 | 4.5 | 4.9 | 1.00 |
File Filtering/Scoping Performance
Testing different file selection modes:
prek run (staged files only)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run |
24.5 ± 0.4 | 23.9 | 25.0 | 1.00 |
prek-head run |
24.7 ± 0.4 | 24.1 | 25.5 | 1.01 ± 0.02 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
5.2 ± 0.1 | 5.1 | 5.3 | 1.00 |
prek-head run --files '*.json' |
5.3 ± 0.1 | 5.1 | 5.8 | 1.01 ± 0.03 |
Workspace Discovery & Initialization
Benchmarking hook discovery and initialization overhead:
prek run --dry-run --all-files (measures init overhead)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --dry-run --all-files |
7.8 ± 1.1 | 6.8 | 10.4 | 1.06 ± 0.16 |
prek-head run --dry-run --all-files |
7.4 ± 0.4 | 7.1 | 9.0 | 1.00 |
Meta Hooks Performance
Benchmarking meta hooks separately:
prek run check-hooks-apply --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-hooks-apply --all-files |
8.3 ± 0.2 | 8.1 | 8.8 | 1.00 |
prek-head run check-hooks-apply --all-files |
8.5 ± 0.4 | 8.2 | 9.8 | 1.02 ± 0.05 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
8.3 ± 0.1 | 8.1 | 8.6 | 1.01 ± 0.02 |
prek-head run check-useless-excludes --all-files |
8.3 ± 0.1 | 8.1 | 8.6 | 1.00 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
7.2 ± 0.2 | 7.0 | 7.9 | 1.00 |
prek-head run identity --all-files |
7.4 ± 0.8 | 6.9 | 10.1 | 1.02 ± 0.11 |
mea to asyncband
|
Thanks! |
Summary
ref fast/asyncband#149