From 1f59f69bfec7bd5e35fc1bf61e332ba642057c6c Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Wed, 8 Apr 2026 13:38:28 -0700 Subject: [PATCH] syntax: basic bench tests --- atproto/syntax/bench_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 atproto/syntax/bench_test.go diff --git a/atproto/syntax/bench_test.go b/atproto/syntax/bench_test.go new file mode 100644 index 00000000..ebcee1f2 --- /dev/null +++ b/atproto/syntax/bench_test.go @@ -0,0 +1,18 @@ +package syntax + +import "testing" + +func BenchmarkParseURI(b *testing.B) { + for b.Loop() { + _, _ = ParseURI("https://example.com/path?query=1#fragment") + } + b.ReportAllocs() +} + +func BenchmarkTIDClock_Next(b *testing.B) { + clock := NewTIDClock(1) + for b.Loop() { + _ = clock.Next() + } + b.ReportAllocs() +} -- 2.51.2