Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Aug 27, 2024
1 parent 53425d5 commit d248f06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- name: Benchmark Target
run: |
export SONIC_NO_ASYNC_GC=1
go test -run ^$ -count=10 -benchtime=100000x -benchmem -bench 'BenchmarkDecoder_(Generic|Binding)_Sonic' ./decoder >> /var/tmp/sonic_bench_target.out
go test -run ^$ -count=10 -benchtime=200000x -benchmem -bench 'BenchmarkEncoder_(Generic|Binding)_Sonic' ./encoder >> /var/tmp/sonic_bench_target.out
go test -run ^$ -count=10 -benchtime=500000x -benchmem -bench 'Benchmark(Get|Set)One_Sonic|BenchmarkParseSeven_Sonic' ./ast >> /var/tmp/sonic_bench_target.out
go test -run ^$ -count=100 -benchtime=100000x -benchmem -bench 'BenchmarkDecoder_(Generic|Binding)_Sonic' ./decoder >> /var/tmp/sonic_bench_target.out
go test -run ^$ -count=100 -benchtime=200000x -benchmem -bench 'BenchmarkEncoder_(Generic|Binding)_Sonic' ./encoder >> /var/tmp/sonic_bench_target.out
go test -run ^$ -count=100 -benchtime=500000x -benchmem -bench 'Benchmark(Get|Set)One_Sonic|BenchmarkParseSeven_Sonic' ./ast >> /var/tmp/sonic_bench_target.out
- name: Clear repository
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
Expand All @@ -44,9 +44,9 @@ jobs:
- name: Benchmark main
run: |
export SONIC_NO_ASYNC_GC=1
go test -run ^$ -count=10 -benchtime=100000x -benchmem -bench 'BenchmarkDecoder_(Generic|Binding)_Sonic' ./decoder >> /var/tmp/sonic_bench_main.out
go test -run ^$ -count=10 -benchtime=200000x -benchmem -bench 'BenchmarkEncoder_(Generic|Binding)_Sonic' ./encoder >> /var/tmp/sonic_bench_main.out
go test -run ^$ -count=10 -benchtime=500000x -benchmem -bench 'Benchmark(Get|Set)One_Sonic|BenchmarkParseSeven_Sonic' ./ast > /var/tmp/sonic_bench_main.out
go test -run ^$ -count=100 -benchtime=100000x -benchmem -bench 'BenchmarkDecoder_(Generic|Binding)_Sonic' ./decoder >> /var/tmp/sonic_bench_main.out
go test -run ^$ -count=100 -benchtime=200000x -benchmem -bench 'BenchmarkEncoder_(Generic|Binding)_Sonic' ./encoder >> /var/tmp/sonic_bench_main.out
go test -run ^$ -count=100 -benchtime=500000x -benchmem -bench 'Benchmark(Get|Set)One_Sonic|BenchmarkParseSeven_Sonic' ./ast > /var/tmp/sonic_bench_main.out
- name: Diff bench
run: |
Expand Down
2 changes: 2 additions & 0 deletions decoder/decoder_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func BenchmarkSkipValidate(b *testing.B) {
C [1]int `json:"c"` // fast int
D struct {} `json:"d"` // empty struct
E map[string]int `json:"e"` // mismatched elem
F json.RawMessage `json:"f"` // unmarshaler
// Unknonwn
}
type C struct {
Expand All @@ -64,6 +65,7 @@ func BenchmarkSkipValidate(b *testing.B) {
{"unknown", `{"unknown":`+compt+`}`, 5},
{"empty", `{"d":`+compt+`}`, 5},
{"mismatched elem", `{"e":`+compt+`}`, 5},
{"unmarshaler", `{"f":`+compt+`}`, 3},
}
_ = NewDecoder(`{}`).Decode(&skiptype{})

Expand Down

0 comments on commit d248f06

Please sign in to comment.