test: add benchmarks for various components
Adds benchmarking tests to ensure the application remains low on resources. Covers payload parsing, auth verification, IRC chat line formatting, and more.
This commit is contained in:
@@ -157,3 +157,15 @@ func TestPersistedOperationHashes(t *testing.T) {
|
||||
t.Fatalf("stream info hash = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFormatErrors(b *testing.B) {
|
||||
errs := []Error{
|
||||
{Message: "first error"},
|
||||
{Message: "second error"},
|
||||
{Message: "third error"},
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = formatErrors(errs)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user