Skip to content

Commit

Permalink
test: add Diff on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Jun 8, 2022
1 parent c4d964e commit 8c0f66c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/benchmark-linux-amd64.yml
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:
build:
runs-on: self-hosted
runs-on: [self-hosted, X64]
steps:
- uses: actions/checkout@v2

Expand All @@ -25,3 +25,6 @@ jobs:
- name: Benchmark
run: sh bench.sh

- name: Diff
run: ./bench.py -b '"^Benchmark.*Sonic"' -c
6 changes: 3 additions & 3 deletions ast/encode_test.go
Expand Up @@ -144,7 +144,7 @@ func TestEncodeNode(t *testing.T) {
}
}

func BenchmarkEncodeRaw(b *testing.B) {
func BenchmarkEncodeRaw_Sonic(b *testing.B) {
data := _TwitterJson
root, e := NewSearcher(data).GetByPath()
if e != nil {
Expand All @@ -164,7 +164,7 @@ func BenchmarkEncodeRaw(b *testing.B) {
}
}

func BenchmarkEncodeSkip(b *testing.B) {
func BenchmarkEncodeSkip_Sonic(b *testing.B) {
data := _TwitterJson
root, e := NewParser(data).Parse()
if e != 0 {
Expand All @@ -185,7 +185,7 @@ func BenchmarkEncodeSkip(b *testing.B) {
}
}

func BenchmarkEncodeLoad(b *testing.B) {
func BenchmarkEncodeLoad_Sonic(b *testing.B) {
data := _TwitterJson
root, e := NewParser(data).Parse()
if e != 0 {
Expand Down
2 changes: 1 addition & 1 deletion bench.py
Expand Up @@ -70,7 +70,7 @@ def compare(args):
run("git checkout -- .")
if current_branch != "main":
run("git checkout main")
run("git pull origin main")
run("git pull --allow-unrelated-histories origin main")

# benchmark main branch
(fd, main) = tempfile.mkstemp(".main.txt")
Expand Down

0 comments on commit 8c0f66c

Please sign in to comment.