2017-07-05 02:34:06 +00:00
|
|
|
package benchmarks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2017-07-05 02:34:06 +00:00
|
|
|
)
|
|
|
|
|
2017-11-11 11:50:01 +00:00
|
|
|
func BenchmarkDatabaseGetAnimeList(b *testing.B) {
|
2017-07-05 02:34:06 +00:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
|
|
|
|
b.RunParallel(func(pb *testing.PB) {
|
|
|
|
for pb.Next() {
|
2017-07-05 11:08:27 +00:00
|
|
|
list, _ := arn.DB.Get("AnimeList", "4J6qpK1ve")
|
|
|
|
animeList := list.(*arn.AnimeList)
|
|
|
|
noop(animeList)
|
2017-07-05 02:34:06 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2017-07-05 11:08:27 +00:00
|
|
|
|
|
|
|
func noop(list *arn.AnimeList) {}
|