26 lines
462 B
Go
Raw Normal View History

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