Skip to content

ci(pm): add benchmark CI workflow - #2566

Merged
elrrrrrrr merged 2 commits into
nextfrom
feat/pm-benchmark
Feb 3, 2026
Merged

ci(pm): add benchmark CI workflow#2566
elrrrrrrr merged 2 commits into
nextfrom
feat/pm-benchmark

Conversation

@elrrrrrrr

Copy link
Copy Markdown
Contributor
  • add benchmark for pm

@elrrrrrrr elrrrrrrr added the A-Pkg Manager Area: Package Manager label Feb 3, 2026
@elrrrrrrr
elrrrrrrr requested a review from killagu February 3, 2026 06:24
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @elrrrrrrr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new continuous integration (CI) workflow focused on benchmarking package manager performance. It provides a robust shell script that automates the process of evaluating installation speeds across different package managers, caching strategies, and npm registries. The aim is to establish a consistent method for monitoring and comparing the efficiency of package managers over time, ensuring optimal performance for dependency resolution and installation.

Highlights

  • New Benchmark Script: A new shell script, e2e/pm-bench.sh, has been added to the repository.
  • Package Manager Benchmarking: The script is designed to benchmark the installation performance of various package managers, specifically utoo, pnpm, and bun.
  • Comprehensive Testing Scenarios: It includes 'cold' (no cache), 'warm' (local files cleaned, global cache present), and 'hot' (manifest cache cleaned, package cache present) install types to simulate different real-world scenarios.
  • Real-world Project and Registry Coverage: Benchmarks are executed against ant-design and ant-design-x projects, utilizing both npmjs.org and npmmirror.com registries for varied network conditions.
  • Automated Workspace Setup: The script includes logic to automatically set up pnpm-workspace.yaml files for projects that define workspaces in their package.json.
Changelog
  • e2e/pm-bench.sh
    • Added a new executable shell script to perform package manager benchmarks.
    • Implemented functions for cloning test projects (ant-design, ant-design-x) and managing temporary directories.
    • Included comprehensive cache cleaning mechanisms for local files, global package manager caches, and manifest-specific caches.
    • Defined run_benchmark function to execute installations for specified package managers (utoo, pnpm, bun) under 'cold', 'warm', and 'hot' conditions.
    • Integrated support for npmjs.org and npmmirror.com registries.
    • Added logic to dynamically create pnpm-workspace.yaml based on package.json workspaces.
    • Configured output to a CSV file and a formatted console table for easy result analysis.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/pm-bench.yml
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive benchmark script for comparing package manager performance. The script is well-structured and covers different scenarios like cold, warm, and hot installs. My review includes several suggestions to improve the script's robustness, maintainability, and the accuracy of the benchmark results. Key points include adding dependency checks, improving error handling for failed installations, and refactoring to reduce code duplication and hardcoded paths.

Comment thread e2e/pm-bench.sh Outdated
Comment thread e2e/pm-bench.sh
Comment thread e2e/pm-bench.sh
}

# Clean global cache for each package manager (including manifest and tgz)
clean_pm_cache() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This function, as well as clean_manifest_cache, uses hardcoded paths to user-specific directories (e.g., ~/.cache/nm, ~/.pnpm-store). This makes the script less portable and might fail if a user has a non-standard configuration. Whenever possible, it's better to retrieve these paths from the package manager itself (e.g., pnpm store path). If that's not possible, consider defining these paths as variables at the top of the script for easier configuration. Additionally, some paths have comments like (to be confirmed) (line 128), which indicates uncertainty and could lead to incorrect benchmark behavior. This should be verified or the code removed.

Comment thread e2e/pm-bench.sh Outdated
- Add dependency checks for required commands at script start
- Use configurable cache paths instead of hardcoded values
- Replace eval with array-based command execution
- Handle installation failures instead of silently ignoring them
- Deduplicate bun manifest cache cleaning logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xusd320 xusd320 changed the title feat(pm): add benchmark CI workflow ci(pm): add benchmark CI workflow Feb 3, 2026

@xusd320 xusd320 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

加个 scope 判断, pack PR 不要跑这个

@elrrrrrrr

Copy link
Copy Markdown
Contributor Author

加个 scope 判断, pack PR 不要跑这个

嗯,现在跑一次比较久,只有手动触发末世

@elrrrrrrr
elrrrrrrr merged commit 7900010 into next Feb 3, 2026
18 checks passed
@elrrrrrrr
elrrrrrrr deleted the feat/pm-benchmark branch February 3, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Pkg Manager Area: Package Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants