-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sado
committed
May 10, 2022
1 parent
af73319
commit f3d2e6a
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package rule | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
func Benchmark_SingleParse(bench *testing.B) { | ||
|
||
for i := 0; i < bench.N; i++ { | ||
New(context.Background(), "1") | ||
} | ||
} | ||
|
||
func Benchmark_Single(bench *testing.B) { | ||
|
||
parser, _ := New(context.Background(), "1") | ||
|
||
bench.ResetTimer() | ||
for i := 0; i < bench.N; i++ { | ||
parser.Eval(nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters