Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b92fc85
perf(pm): install hot-path — TTY-gate progress, stream layer joins, z…
elrrrrrrr May 2, 2026
9df637f
perf(pm): release download permit before CPU-bound extract phase
elrrrrrrr May 3, 2026
dff9fb2
perf(pm): linearize extract dir collection — Vec + sort+dedup over pe…
elrrrrrrr May 3, 2026
f013fcb
perf(pm): skip update_package_binary for npm.org registry
elrrrrrrr May 3, 2026
5d0b856
perf(pm): find_real_src uses file_type instead of metadata
elrrrrrrr May 3, 2026
d688101
perf(pm): OnceMap fast-path eliminates spawn + alloc churn on cache hit
elrrrrrrr May 3, 2026
f91930f
Merge branch 'next' into perf/install-micro-opts
elrrrrrrr May 3, 2026
aaf9582
perf(pm): drop PathBuf alloc + redundant len-sort in extract dir coll…
elrrrrrrr May 6, 2026
25d1f25
Merge branch 'next' into perf/install-micro-opts
elrrrrrrr May 6, 2026
d3e7363
perf(pm): add OnceMap::get for single-lookup cached value retrieval
elrrrrrrr May 6, 2026
8f5959e
Revert "perf(pm): add OnceMap::get for single-lookup cached value ret…
elrrrrrrr May 6, 2026
b53e9c0
Reapply "perf(pm): add OnceMap::get for single-lookup cached value re…
elrrrrrrr May 6, 2026
b389ae3
Merge branch 'next' into perf/install-micro-opts
elrrrrrrr May 6, 2026
900ab16
refactor(pm): /simplify cleanup — comment trim + leaky-abstraction fix
elrrrrrrr May 6, 2026
996f632
Merge branch 'next' into perf/install-micro-opts
elrrrrrrr May 6, 2026
d94ae10
Revert "perf(pm): release download permit before CPU-bound extract ph…
elrrrrrrr May 6, 2026
8ff8fb4
ci: trigger bench
elrrrrrrr May 6, 2026
7d6dd81
experiment(pm): A/B revert install_packages eager skip
elrrrrrrr May 6, 2026
5e1c424
experiment(pm): A/B revert install hot-path triplet (TTY-gate + strea…
elrrrrrrr May 6, 2026
f12d763
Merge branch 'next' of github.com:utooland/utoo into perf/install-mic…
elrrrrrrr May 6, 2026
d513dbb
chore: restore Cargo.lock to origin/next baseline
elrrrrrrr May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/pm/src/service/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ async fn handle_cypress(
}

pub async fn update_package_binary(dir: &Path, name: &str) -> Result<()> {
// npm.org has no China mirror layer — skip alongside `get_envs`.
if should_skip_binary_mirror() {
return Ok(());
}

let config = load_config().await?;

let mirrors = config["mirrors"]["china"]
Expand Down
15 changes: 13 additions & 2 deletions crates/pm/src/util/cloner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ pub async fn clone_package_once(
target_path: &Path,
) -> Result<()> {
let key = cache_key(target_path);

// Skip the param clones + future construction when the pipeline
// (or a sibling task) already cloned this target.
if CLONE_CACHE.is_done(&key) {
return Ok(());
}

let err_label = format!("{name}@{version}");
let name = name.to_string();
let version = version.to_string();
Expand Down Expand Up @@ -326,8 +333,12 @@ async fn validate_directory(src: &Path, dst: &Path) -> Result<bool> {
pub async fn find_real_src<P: AsRef<Path>>(src: P) -> Option<PathBuf> {
let mut read_dir = fs::read_dir(src.as_ref()).await.ok()?;
while let Some(entry) = read_dir.next_entry().await.ok()? {
if let Ok(metadata) = entry.metadata().await
&& metadata.is_dir()
// `file_type()` reads `d_type` from the cached readdir result on
// ext4/btrfs/xfs (no extra syscall); `metadata()` always issues
// an `lstat`. Saves ~3–5 stats per call × N packages on the
// cold install hot path.
if let Ok(file_type) = entry.file_type().await
&& file_type.is_dir()
&& let Some(name) = entry.path().file_name()
&& name.to_string_lossy() != ".utoo_built"
{
Expand Down
10 changes: 9 additions & 1 deletion crates/pm/src/util/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ pub async fn resolve_cache_path(name: &str, version: &str, tarball_url: &str) ->
/// For git-resolved packages, use [`resolve_cache_path`] instead.
pub async fn download_to_cache(name: &str, version: &str, tarball_url: &str) -> Option<PathBuf> {
let key = format!("{}@{}", name, version);

// Skip the param clones + future construction on cache hit.
if let Some(cache_path) = DOWNLOAD_CACHE.get(&key) {
return Some((*cache_path).clone());
}

let cache_dir = get_cache_dir();
let name = name.to_string();
let version = version.to_string();
Expand All @@ -167,7 +173,9 @@ pub async fn download_to_cache(name: &str, version: &str, tarball_url: &str) ->
return Some(cache_path);
}

// Download (semaphore controlled)
// Download (semaphore controlled). Permit held through extract
// — A/B-revert experiment to test if early permit release is
// the source of utoo p0 σ being ~2× baseline.
let semaphore = DOWNLOAD_SEMAPHORE
.get_or_init(|| Semaphore::new(get_manifests_concurrency_limit_sync()));
let _permit = semaphore.acquire().await.ok()?;
Expand Down
15 changes: 15 additions & 0 deletions crates/ruborist/src/util/oncemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ where
}
}

/// Sync presence probe — `Done` only, single `DashMap::get`.
/// Returns `false` for unknown / `Waiting` slots.
pub fn is_done(&self, key: &K) -> bool {
self.get(key).is_some()
}

/// Sync fetch of a completed value, single `DashMap::get`.
/// Returns `None` for unknown / `Waiting` slots.
pub fn get(&self, key: &K) -> Option<Arc<V>> {
self.map.get(key).and_then(|e| match e.value() {
Value::Done(v) => Some(Arc::clone(v)),
Value::Waiting(_) => None,
})
}
Comment thread
elrrrrrrr marked this conversation as resolved.
Resolved

/// Wait for a key to complete.
///
/// - If the key exists and is Done, returns immediately.
Expand Down
Loading