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:
2026-05-16 21:54:40 +09:00
parent d38d306147
commit c2ff9c9fa5
3 changed files with 679 additions and 0 deletions

View File

@@ -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()
}
}