Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 36 additions & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,42 @@ jobs:
path: node

- name: Run benchmarks
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3
uses: CodSpeedHQ/action@ca909ca8b60401c041f627a1d9117aa90dce9524 # v5.8.1
with:
mode: simulation,memory
run: node --run bench

# The CLI end to end with its worker threads, from `codspeed.yml`, on a
# dedicated machine so that real time is stable
walltime:
name: Benchmarks (walltime)
runs-on: codspeed-macro-x64-ryzen-9950x-ubuntu-24-04
permissions:
contents: read
id-token: write
env:
NODE_SHA: 768315cf7165e9ff9b636844b776488e9d1703fc
steps:
- name: Setup environment
uses: nodejs/web-team/actions/setup-environment@4c0b18db11a8357664683d70ef1f27af08ecc766
with:
use-version-file: true
pnpm: true

- name: Checkout Node.js sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: nodejs/node
ref: ${{ env.NODE_SHA }}
sparse-checkout: |
doc
lib
.
path: node

# Without `run`, the action runs the benchmarks of `codspeed.yml`
- name: Run benchmarks
uses: CodSpeedHQ/action@ca909ca8b60401c041f627a1d9117aa90dce9524 # v5.8.1
with:
mode: walltime
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ every pull request and reports CPU and memory there.
node --run bench
```

The CLI is also measured end to end, with its default worker threads, on every
Node.js API doc: `codspeed.yml` lists these runs, and CI measures their real
time on a dedicated CodSpeed machine. With the
[CodSpeed CLI](https://codspeed.io/docs/cli) and `./node` checked out, run them
with `codspeed run -m walltime`.

## Code Quality

### Linting and Formatting
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<a href="https://www.bestpractices.dev/projects/29">
<img src="https://www.bestpractices.dev/projects/29/badge" alt="CII Best Practices badge">
</a>
<a href="https://app.codspeed.io/nodejs/doc-kit?utm_source=badge">
<img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed"/>
</a>
</p>

## Usage
Expand Down
34 changes: 34 additions & 0 deletions codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$schema: https://raw.githubusercontent.com/CodSpeedHQ/codspeed/refs/heads/main/schemas/codspeed.schema.json

# End-to-end runs of the CLI with its default worker threads, measured in
# walltime by `codspeed run -m walltime`. They read the checkout of nodejs/node
# in `./node`. The single-threaded benchmarks are in `bench/` instead.

options:
warmup-time: 0s
max-rounds: 5

benchmarks:
- name: generate json
exec: node packages/cli/bin/cli.mjs generate -t json -i 'node/doc/api/*.md' -o out/json --type-map node/doc/type-map.json --index node/doc/api/index.md

- name: generate legacy-json
exec: node packages/cli/bin/cli.mjs generate -t legacy-json -i 'node/doc/api/*.md' -o out/legacy-json --type-map node/doc/type-map.json --index node/doc/api/index.md

- name: generate legacy-html
exec: node packages/cli/bin/cli.mjs generate -t legacy-html -i 'node/doc/api/*.md' -o out/legacy-html --type-map node/doc/type-map.json --index node/doc/api/index.md -c node/CHANGELOG.md

- name: generate html
exec: node packages/cli/bin/cli.mjs generate -t html -i 'node/doc/api/*.md' -o out/html --type-map node/doc/type-map.json --index node/doc/api/index.md -c node/CHANGELOG.md

- name: generate llms-txt
exec: node packages/cli/bin/cli.mjs generate -t llms-txt -i 'node/doc/api/*.md' -o out/llms-txt --type-map node/doc/type-map.json --index node/doc/api/index.md

- name: generate orama-db
exec: node packages/cli/bin/cli.mjs generate -t orama-db -i 'node/doc/api/*.md' -o out/orama-db --type-map node/doc/type-map.json --index node/doc/api/index.md

- name: generate man-page
exec: node packages/cli/bin/cli.mjs generate -t man-page -i node/doc/api/cli.md -o out/man-page

- name: generate api-links
exec: node packages/cli/bin/cli.mjs generate -t api-links -i 'node/lib/*.js' -o out/api-links
Loading