Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
add benchmark for parse file (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvgw authored Dec 27, 2019
1 parent 1bf84fa commit de9f6c5
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
66 changes: 66 additions & 0 deletions mockgen/internal/tests/performance/big_interface/big_interface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package big_interface

type Bar struct{}

type BigInterface interface {
Foo1(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo2(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo3(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo4(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo5(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo6(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo7(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo8(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo9(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo10(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo11(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo12(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo13(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo14(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo15(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo16(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo17(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo18(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo19(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo20(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo21(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo22(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo23(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo24(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo25(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo26(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo27(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo28(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo29(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo30(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo31(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo32(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo33(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo34(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo35(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo36(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo37(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo38(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo39(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo40(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo41(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo42(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo43(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo44(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo45(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo46(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo47(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo48(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo49(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo50(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo51(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo52(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo53(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo54(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo55(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo56(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo57(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo58(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo59(bool, bool, bool, bool, bool, bool, bool, bool) Bar
Foo60(bool, bool, bool, bool, bool, bool, bool, bool) Bar
}
7 changes: 7 additions & 0 deletions mockgen/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ func checkGreeterImports(t *testing.T, imports map[string]string) {
t.Errorf("Expected import not to have key \"v1\"")
}
}

func Benchmark_parseFile(b *testing.B) {
source := "internal/tests/performance/big_interface/big_interface.go"
for n := 0; n < b.N; n++ {
parseFile(source)
}
}

0 comments on commit de9f6c5

Please sign in to comment.