Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CodSpeed Benchmarks #4243

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
114d936
experiment: add codspeed
erikwrede Oct 3, 2024
016acb6
fix: make esm loader happy
erikwrede Oct 9, 2024
ccf912d
fix: use correct node command
erikwrede Oct 9, 2024
3b899ec
chore: trigger codspeed run
erikwrede Oct 9, 2024
06734cf
experiment: add codspeed using vitest
erikwrede Oct 17, 2024
fe41a4c
chore: lint
erikwrede Oct 17, 2024
71a3028
fix: revert import broken by lint
erikwrede Oct 17, 2024
dd0629f
experiment: try out patching
erikwrede Oct 17, 2024
1425baa
chore: enable env:
erikwrede Oct 17, 2024
64729f8
trigger codspeed
erikwrede Oct 17, 2024
9c713c9
fix: adjust ci & lint to new benchmarks
erikwrede Oct 17, 2024
badafc1
refactor: remove types/chai to prevent type conflicts. they now come …
erikwrede Oct 17, 2024
e43ff47
chore: prettier
erikwrede Oct 17, 2024
e1f79a2
fix: commonly ignored files
erikwrede Oct 17, 2024
ef74c7d
chore: prettier
erikwrede Oct 17, 2024
3c83dfd
chore: add codspeed to spellcheck
erikwrede Oct 17, 2024
d88e025
chore: remove unused codspeed command
erikwrede Oct 17, 2024
9c771c0
fix: rename files
erikwrede Oct 18, 2024
b5b3049
chore: patch codspeed
erikwrede Oct 20, 2024
04fa980
chore: fix patch
erikwrede Oct 20, 2024
6c49c41
chore: remove tinybench plugin
erikwrede Oct 20, 2024
8eb26fb
fix: adjust commonly ignored files workflow
erikwrede Oct 20, 2024
0cc1c05
chore: unpin tinybench
erikwrede Oct 21, 2024
0574c6b
Merge remote-tracking branch 'origin/main' into feat/codspeed-vitest
erikwrede Oct 21, 2024
680b88d
chore: update to newest codspeed version, remove patch package
erikwrede Jan 17, 2025
db809ec
chore: update to newest codspeed version, remove patch package
erikwrede Jan 17, 2025
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
1 change: 1 addition & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"exclude": [
"src/**/index.ts",
"src/**/*-fuzz.ts",
"src/**/__benchmarks__/*.ts",
"src/jsutils/Maybe.ts",
"src/jsutils/ObjMap.ts",
"src/jsutils/PromiseOrValue.ts",
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

# Ignore TS files inside integration test
/integrationTests/ts/*.ts

# Ignore config files
/vitest.config.ts
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ module.exports = {
],
},
},
{
files: 'src/**/__benchmarks__/**',
rules: {
'import/no-nodejs-modules': 'off',
},
},
{
files: 'integrationTests/*',
env: {
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check if commit contains files that should be ignored
run: |
git clone --depth 1 https://github.com/github/gitignore.git

rm gitignore/Global/ModelSim.gitignore
rm gitignore/Global/Images.gitignore
cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore

IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
IGNORED_FILES_UNPROCESSED=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
IGNORED_FILES=$(grep -v -F "patches/@codspeed+core+3.1.1.patch" <<< "$IGNORED_FILES_UNPROCESSED" || true)
IGNORED_FILES=$(grep -v -F "patches/@codspeed+vitest-plugin+3.1.1.patch" <<< "$IGNORED_FILES_UNPROCESSED" || true)
Comment on lines +60 to +61
Copy link
Member

Choose a reason for hiding this comment

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

We might want to wait until these patches are published


echo "IGNORED_FILES: $IGNORED_FILES"
if [[ "$IGNORED_FILES" != "" ]]; then
echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g'
exit 1
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CodSpeed Benchmarks

on:
push:
branches:
- 'main' # or "master"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-node@v3'
- name: Install dependencies
run: npm install
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
env:
CODSPEED_FORCE_OPTIMIZATION: true
with:
run: npm exec vitest bench
token: ${{ secrets.CODSPEED_TOKEN }}
5 changes: 4 additions & 1 deletion cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ignorePaths:
- package.json
- benchmark/github-schema.graphql
- benchmark/github-schema.json
- patches
- src/__benchmarks__/github-schema.json
- src/__benchmarks__/github-schema.graphql
Comment on lines +11 to +12
Copy link
Author

Choose a reason for hiding this comment

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

We could merge these two with the existing benchmark resource files into a shared folder

overrides:
- filename: '**/docs-old/APIReference-*.md'
ignoreRegExpList: ['/href="[^"]*"/']
Expand Down Expand Up @@ -34,7 +37,7 @@ ignoreRegExpList:

words:
- graphiql

- codspeed
# Different names used inside tests
- Skywalker
- Leia
Expand Down
Loading
Loading