Skip to content

Commit

Permalink
Add benchmark using cachegrind
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Sep 23, 2023
1 parent f31f66a commit bcd2b40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set up
run:
sudo apt-get update
sudo apt-get install -y valgrind

- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -38,6 +43,9 @@ jobs:
- name: Run benchmark
run: make benchmark

- name: Run cachegrind
run: make cachegrind

- name: Run octocov
uses: k1LoW/octocov-action@v0
env:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ benchmark: depsdev
go mod tidy -modfile=testdata/go_test.mod
go test -modfile=testdata/go_test.mod -bench . -benchmem -benchtime 10000x -run Benchmark | octocov-go-test-bench --tee > custom_metrics_benchmark.json

cachegrind: depsdev
go mod tidy -modfile=testdata/go_test.mod
valgrind --tool=cachegrind go test -modfile=testdata/go_test.mod -bench . -benchmem -benchtime 10000x -run Benchmark

lint:
go mod tidy
golangci-lint run ./...
Expand Down

0 comments on commit bcd2b40

Please sign in to comment.