26 lines
462 B
Go
Raw Normal View History

2017-06-26 16:23:38 +02:00
package benchmarks
import (
"testing"
2019-06-03 18:32:43 +09:00
"github.com/animenotifier/notify.moe/arn"
2017-06-26 16:23:38 +02:00
"github.com/animenotifier/notify.moe/components"
)
2017-07-05 13:46:20 +02:00
func BenchmarkRenderThread(b *testing.B) {
2017-06-26 16:23:38 +02:00
thread, _ := arn.GetThread("HJgS7c2K")
thread.HTML() // Pre-render markdown
2018-10-29 13:47:13 +09:00
replies := thread.Posts()
2017-06-26 16:23:38 +02:00
2018-10-29 13:47:13 +09:00
for _, reply := range replies {
reply.HTML() // Pre-render markdown
}
2017-06-26 16:23:38 +02:00
b.ReportAllocs()
b.ResetTimer()
2019-11-18 13:15:07 +09:00
for i := 0; i < b.N; i++ {
components.Thread(thread, nil)
}
2017-07-05 04:10:19 +02:00
}