Files
parasocial/internal/tui/model_bench_test.go
ruinivist 7acb293dea 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.
2026-05-31 23:13:18 +00:00

29 lines
613 B
Go

package tui
import "testing"
import "parasocial/internal/twitch"
func BenchmarkFormatIRCChatLine(b *testing.B) {
line := ":jules!jules@jules.tmi.twitch.tv PRIVMSG #parasocial :Hello world this is a test message"
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = formatIRCChatLine(line)
}
}
func BenchmarkNormalizeKey(b *testing.B) {
key := "SomeStreamerName"
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = normalizeKey(key)
}
}
func BenchmarkIsActive(b *testing.B) {
entry := twitch.StreamerEntry{Status: twitch.StreamerReady}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = isActive(entry)
}
}