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

ci: add initial benchmark infrastructure #3084

Merged
merged 38 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ad814e9
test: introduce initial wallet benchmark tests
maschad May 6, 2024
b3d98f1
Merge branch 'master' into tests/add-benchmark-tests
maschad May 29, 2024
00e7d6b
test: use clinic for flame and profile tests
maschad May 31, 2024
df3f7f6
test: added doctor and heap profiling
maschad May 31, 2024
352c33a
build: add dynamic scripts + account profiling
maschad Jun 1, 2024
2be51be
test: added more benchmark tests
maschad Jun 2, 2024
01338f5
Merge branch 'master' into mc/test/performance-tests
maschad Jun 2, 2024
5395454
test: update crypto benchmarking
maschad Jun 4, 2024
08e95fb
Merge branch 'master' into mc/test/performance-tests
maschad Sep 1, 2024
0703485
build: update lock file
maschad Sep 1, 2024
89f2878
Merge branch 'master' into mc/test/performance-tests
maschad Sep 2, 2024
b23cd12
build: resolve build issues
maschad Sep 2, 2024
bb8d58d
feat: added benchmarks for cost estimation
maschad Sep 3, 2024
7fefa3c
feat: added transaction results benchmarks
maschad Sep 3, 2024
135edfe
ci: add initial benchmark workflow
maschad Sep 3, 2024
2b0ef79
Merge branch 'master' into mc/test/performance-tests
maschad Sep 5, 2024
4d00d70
ci: integrate codespeed
maschad Sep 5, 2024
008dc78
build: move bench marks to internal folder
maschad Sep 5, 2024
6d7338c
test: remove unrelated abi coder tests
maschad Sep 7, 2024
54aa319
Merge branch 'master' into mc/test/performance-tests
maschad Sep 7, 2024
493d7ad
restore relevant abi-coder files
maschad Sep 7, 2024
b8fb315
fix: remove unnecessary delay
maschad Sep 7, 2024
c2f6036
build: update lockfile
maschad Sep 7, 2024
4277eab
restore account package
maschad Sep 7, 2024
c1cd693
ci: update benchmark command
maschad Sep 7, 2024
7ee57c2
docs: add changeset + pretest command
maschad Sep 7, 2024
a7d3e5e
lint: format forc.toml
maschad Sep 7, 2024
6ef92fd
Merge branch 'master' into mc/test/performance-tests
maschad Sep 8, 2024
6c4acd7
Merge branch 'master' into mc/test/performance-tests
maschad Sep 9, 2024
a0597b9
pr updates
maschad Sep 9, 2024
5d96aab
Merge branch 'master' into mc/test/performance-tests
maschad Sep 9, 2024
38a228a
resolve lockfile issue
maschad Sep 9, 2024
9281eae
ci: update benchmark workflow
maschad Sep 9, 2024
8385216
ci: remove browser benchmark job
maschad Sep 9, 2024
61807c4
docs: add docs for benchmarking and profiling
maschad Sep 9, 2024
c4bbf94
feat: add contract read, write, mint benches
maschad Sep 10, 2024
d1454d6
deps: remove 0x
maschad Sep 10, 2024
20ab594
Merge branch 'master' into mc/test/performance-tests
maschad Sep 12, 2024
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
38 changes: 38 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Benchmarks
on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: CI Setup
uses: ./.github/actions/test-setup

# Run benchmark and stores the output to a file
- name: Run benchmark
run: pnpm node:bench | tee benchmark_results.txt

# Process the output to check for performance regression
- name: Process benchmark results
id: benchmark
run: |
RESULTS=$(cat benchmark_results.txt | sed 's/$/\\n/' | tr -d '\n')
echo "results<<EOF" >> $GITHUB_OUTPUT
echo "$RESULTS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
body: |
# Benchmark results
${{ steps.benchmark.outputs.results }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ lib-cov
*.pid
*.gz
*.swp
*.0x/*

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand Down Expand Up @@ -144,6 +145,10 @@ Forc.lock
**/out/release
**/test-predicate-*/index.ts

## Ignore perf test files
*clinic*
.clinic/*

# Ignore typegen test files
**/test/typegen

Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
"test:validate": "./scripts/tests-validate.sh",
"test:browser:filter": "vitest --run --coverage false --config vitest.browser.config.mts",
"test:e2e": "vitest --run --config vitest.node.config.mts $(scripts/tests-find.sh --e2e)",
"bench:node": "vitest bench --run --config vitest.node.config.mts $(scripts/tests-find.sh)",
"bench:node:filter": "vitest bench --run --config vitest.node.config.mts",
"clinic:flame": "clinic flame --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"clinic:bubble": "clinic bubbleprof --autocannon [ -c 5 -a 500 / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"clinic:doctor": "clinic doctor --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"clinic:heap": "clinic heapprofiler --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js",
"0x": "0x -o -P 'autocannon localhost:$PORT' -- node packages/${npm_config_package_name}/dist/profile.js",
"test:integration": "vitest --run --config vitest.node.config.mts $(scripts/tests-find.sh --integration)",
"lint": "run-s lint:check prettier:check",
"lint:check": "eslint . --ext .ts --max-warnings 0",
Expand Down Expand Up @@ -62,6 +69,7 @@
},
"homepage": "https://github.com/FuelLabs/fuels-ts#readme",
"devDependencies": {
"0x": "^5.7.0",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@changesets/cli": "^2.27.7",
Expand All @@ -82,6 +90,8 @@
"@typescript-eslint/parser": "^6.21.0",
"@vitest/browser": "^1.6.0",
"@vitest/coverage-istanbul": "^1.6.0",
"autocannon": "^7.15.0",
"clinic": "^13.0.0",
"compare-versions": "^6.1.1",
"coverage-diff": "^3.2.0",
"eslint": "^8.57.0",
Expand Down
1 change: 1 addition & 0 deletions packages/abi-coder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@fuel-ts/interfaces": "workspace:*",
"@fuel-ts/math": "workspace:*",
"@fuel-ts/utils": "workspace:*",
"restify": "^11.1.0",
"type-fest": "^4.24.0"
}
}
Loading
Loading