forked from rosa/hakurei
internal/rosa/azalea: evaluator
Performance is sufficient for the use case, despite the fact that I could not even think of a lower-effort way to do this: BenchmarkParse-128 55100 21494 ns/op BenchmarkEvaluate-128 131670 9248 ns/op Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -154,3 +154,16 @@ func TestParse(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParse(b *testing.B) {
|
||||
r := strings.NewReader(sample)
|
||||
for b.Loop() {
|
||||
if _, err := Parse(r); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
||||
b.StopTimer()
|
||||
r.Reset(sample)
|
||||
b.StartTimer()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user