Improved anime list serialization speed
This commit is contained in:
parent
8dbc8f17cf
commit
288ca35ec8
@ -7,12 +7,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkDBGetMap(b *testing.B) {
|
func BenchmarkDBGetMap(b *testing.B) {
|
||||||
|
user, _ := arn.GetUser("4J6qpK1ve")
|
||||||
|
|
||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|
||||||
b.RunParallel(func(pb *testing.PB) {
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
for pb.Next() {
|
for pb.Next() {
|
||||||
arn.DB.GetMap("AnimeList", "4J6qpK1ve")
|
animeList, _ := arn.GetAnimeList(user)
|
||||||
|
noop(animeList)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -23,7 +26,11 @@ func BenchmarkDBGet(b *testing.B) {
|
|||||||
|
|
||||||
b.RunParallel(func(pb *testing.PB) {
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
for pb.Next() {
|
for pb.Next() {
|
||||||
arn.DB.Get("AnimeList", "4J6qpK1ve")
|
list, _ := arn.DB.Get("AnimeList", "4J6qpK1ve")
|
||||||
|
animeList := list.(*arn.AnimeList)
|
||||||
|
noop(animeList)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func noop(list *arn.AnimeList) {}
|
||||||
|
@ -64,4 +64,4 @@ nav-height = 3.11rem
|
|||||||
|
|
||||||
// Timings
|
// Timings
|
||||||
fade-speed = 200ms
|
fade-speed = 200ms
|
||||||
transition-speed = 270ms
|
transition-speed = 250ms
|
1
tests.go
1
tests.go
@ -160,6 +160,7 @@ var routeTests = map[string][]string{
|
|||||||
"/auth/facebook/callback": nil,
|
"/auth/facebook/callback": nil,
|
||||||
"/import": nil,
|
"/import": nil,
|
||||||
"/import/anilist/animelist": nil,
|
"/import/anilist/animelist": nil,
|
||||||
|
"/import/anilist/animelist/finish": nil,
|
||||||
"/anime/:id/edit": nil,
|
"/anime/:id/edit": nil,
|
||||||
"/new/thread": nil,
|
"/new/thread": nil,
|
||||||
"/new/soundtrack": nil,
|
"/new/soundtrack": nil,
|
||||||
|
Loading…
Reference in New Issue
Block a user