Repository navigation
ci: benchmark inup against similar tools - #187
Merged
Merged
Conversation
Adds a Benchmark workflow that times inup next to npm-check-updates, taze, npm-check and the repository's own npm/pnpm outdated, with hyperfine, on public repositories pinned to a commit (express, vuejs/core, TanStack/query). Each tool is asked for every outdated dependency, headless, launch to exit; first runs start with empty caches, repeat runs keep them. The workflow runs on demand and after each npm publish, and opens a pull request that updates a README "Speed" section (chart + tables) and docs/guide/benchmarks.md. Pull requests that change the benchmark get a short run with the tables in the job summary. Also regenerates the test badge: the new script tests took it past the drift limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Benchmark workflow that compares inup with the tools people use for the same job, and publishes the results to the README the same way the demo GIF is published: as a pull request to review.
What it measures
Every tool is asked the same question: which dependencies, in every
package.jsonof the repository, are behind their latest version? Each one runs headless with flags that check every dependency and write nothing. hyperfine times it from launch to exit.inup --jsonncu --jsonUpgraded [--workspaces]taze major [--recursive] --include-locked --no-github-actions --no-node-version --jsonnpm-check --skip-unused(single package only: no workspace support)npm outdated --json/pnpm outdated --recursive --format jsonRepositories, pinned to a commit:
expressjs/express(npm, 44 deps),vuejs/core(pnpm, 22 packages),TanStack/query(pnpm, 105 packages).HOME, fresh XDG folders and a freshTMPDIR, so every cache it keeps is empty.How it runs
.github/workflows/benchmark.ymlhas one job per repository onubuntu-24.04. It installs hyperfine 1.20.0 (pinned, sha256-checked), inup from the commit being tested, and the other tools at their latest npm versions. Each tool's version is recorded.After a manual dispatch or a successful Publish to npm, the report job renders the results and opens or updates an
automated-benchmarkPR. That PR changes:docs/guide/benchmarks.mddocs/benchmark/speed-{light,dark}.svgIt uses the same
GH_PAT/GH_EMAIL/GH_USERNAMEsecrets as the demo workflow.A pull request that changes the benchmark gets a 3-run check, with the tables in the job summary only. This PR runs it.
Locally:
pnpm bench:compare --fixture vue-core(needs hyperfine), thennode scripts/bench-report.mjs bench-results/*.json.The README markers are invisible until the first workflow run fills them, so no numbers reach the README except from CI.
Fairness notes (also on the docs page)
npm.antfu.dev) by default. It also answers repeat runs within 30 minutes from its cache, without contacting the registry. inup revalidates with the registry on every run.Local sample (MacBook, 2 runs, not published)
On repeat runs taze (express, 0.14 s) and
pnpm outdated(vuejs/core, 0.38 s) beat inup. The published tables will show that as measured.Also
test/unit/scripts/bench-compare.test.tscovers command building, sandboxing, exit codes and output parsing.test/unit/scripts/bench-report.test.tscovers the tables, docs page, chart and README splicing.