2017-07-05 02:34:06 +00:00
|
|
|
package benchmarks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
)
|
|
|
|
|
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) {}
|