ci(pm): add benchmark CI workflow - #2566
Conversation
Summary of ChangesHello @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
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| # Clean global cache for each package manager (including manifest and tgz) | ||
| clean_pm_cache() { |
There was a problem hiding this comment.
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.
- 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
left a comment
There was a problem hiding this comment.
加个 scope 判断, pack PR 不要跑这个
嗯,现在跑一次比较久,只有手动触发末世 |
benchmarkfor pm