aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/azalea/azalea_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-16 21:54:40 +0900
committerOphestra <cat@gensokyo.uk>2026-05-17 12:44:34 +0900
commitc2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (patch)
treefa1eaf0fcbd8bbd29fb3eb156a1c2fd8d35c66f8 /internal/rosa/azalea/azalea_test.go
parentd38d306147979cbc7f161d1150d6786572598497 (diff)
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>
Diffstat (limited to 'internal/rosa/azalea/azalea_test.go')
-rw-r--r--internal/rosa/azalea/azalea_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/rosa/azalea/azalea_test.go b/internal/rosa/azalea/azalea_test.go
index f2dec252..73330412 100644
--- a/internal/rosa/azalea/azalea_test.go
+++ b/internal/rosa/azalea/azalea_test.go
@@ -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()
+ }
+}