Skip to content

Commit e7d205b

Browse files
authored
Add nope-id to benchmark (#591)
* Add nope-id to benchmark * Run benchmarks on PRs * Update nope-id * Typo
1 parent ecd9b6a commit e7d205b

6 files changed

Lines changed: 46 additions & 23 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Benchmark
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
pull_request:
7+
permissions:
8+
contents: read
9+
jobs:
10+
benchmark:
11+
name: Benchmark
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
18+
with:
19+
version: 11
20+
- name: Install Node.js
21+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
22+
with:
23+
node-version: 26
24+
cache: pnpm
25+
- name: Install dependencies
26+
run: pnpm install --ignore-scripts
27+
- name: Run benchmark
28+
run: node ./test/benchmark.js

.github/workflows/release.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ on:
33
push:
44
tags:
55
- '*'
6+
permissions:
7+
contents: write
68
jobs:
79
release:
810
name: Release On Tag
911
if: startsWith(github.ref, 'refs/tags/')
1012
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
1313
steps:
1414
- name: Checkout the repository
1515
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -42,24 +42,3 @@ jobs:
4242
body: '${{ steps.changelog.outputs.changelog_content }}'
4343
draft: false
4444
prerelease: false
45-
benchmark:
46-
name: Benchmark
47-
runs-on: ubuntu-latest
48-
permissions:
49-
contents: read
50-
steps:
51-
- name: Checkout the repository
52-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
53-
- name: Install pnpm
54-
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
55-
with:
56-
version: 10
57-
- name: Install Node.js
58-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
59-
with:
60-
node-version: 24
61-
cache: pnpm
62-
- name: Install dependencies
63-
run: pnpm install --ignore-scripts
64-
- name: Run benchmark
65-
run: node ./test/benchmark.js

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"better-node-test": "^0.8.4",
6262
"clean-publish": "^7.1.0",
6363
"eslint-plugin-prefer-let": "^4.2.2",
64+
"nope-id": "^1.1.0",
6465
"oxlint": "^1.66.0",
6566
"oxlint-tsgolint": "^0.23.0",
6667
"rndm": "^1.2.0",

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
allowBuilds:
22
simple-git-hooks: true
3+
minimumReleaseAgeExclude:
4+
- nope-id

test/benchmark.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { v4 as lukeed4 } from '@lukeed/uuid'
44
import { v4 as napiV4 } from '@napi-rs/uuid'
55
import crypto from 'node:crypto'
66
import { styleText } from 'node:util'
7+
import { nopeid } from 'nope-id'
78
import rndm from 'rndm'
89
import srs from 'secure-random-string'
910
import { Bench } from 'tinybench'
@@ -36,6 +37,9 @@ bench
3637
.add('@lukeed/uuid', () => {
3738
lukeed4()
3839
})
40+
.add('nope-id', () => {
41+
nopeid()
42+
})
3943
.add('nanoid', () => {
4044
nanoid()
4145
})

0 commit comments

Comments
 (0)