diff --git a/.gitignore b/.gitignore index 901b7b49..4aeada51 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ _testmain.go *.exe *.test *.prof +*.pprof # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/benchmarks/Components_test.go b/benchmarks/Components_test.go index ef68455e..d954fd86 100644 --- a/benchmarks/Components_test.go +++ b/benchmarks/Components_test.go @@ -25,3 +25,17 @@ func BenchmarkThread(b *testing.B) { } }) } + +func BenchmarkAnimeList(b *testing.B) { + user, _ := arn.GetUser("4J6qpK1ve") + animeList := user.AnimeList() + + b.ReportAllocs() + b.ResetTimer() + + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + components.AnimeList(animeList, user, user) + } + }) +} diff --git a/pages/settings/settings.pixy b/pages/settings/settings.pixy index 42a6b118..0580ddc4 100644 --- a/pages/settings/settings.pixy +++ b/pages/settings/settings.pixy @@ -56,6 +56,16 @@ component Settings(user *arn.User) ImportLists(user) + .widget.mountable + h3.widget-title + Icon("puzzle-piece") + span Extensions + + .buttons + button.action(data-action="installExtension", data-trigger="click") + Icon("chrome") + span Get the Chrome Extension + //- .widget.mountable(data-api="/api/settings/" + user.ID) //- h3.widget-title //- Icon("cogs") diff --git a/profiler.go b/profiler.go new file mode 100644 index 00000000..b77e04a3 --- /dev/null +++ b/profiler.go @@ -0,0 +1,16 @@ +package main + +func init() { + // Uncomment these if you want to enable live profiling via /debug/pprof + + // app.Router.HandlerFunc("GET", "/debug/pprof/", http.HandlerFunc(pprof.Index)) + // app.Router.HandlerFunc("GET", "/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline)) + // app.Router.HandlerFunc("GET", "/debug/pprof/profile", http.HandlerFunc(pprof.Profile)) + // app.Router.HandlerFunc("GET", "/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol)) + // app.Router.HandlerFunc("GET", "/debug/pprof/trace", http.HandlerFunc(pprof.Trace)) + + // app.Router.Handler("GET", "/debug/pprof/goroutine", pprof.Handler("goroutine")) + // app.Router.Handler("GET", "/debug/pprof/heap", pprof.Handler("heap")) + // app.Router.Handler("GET", "/debug/pprof/threadcreate", pprof.Handler("threadcreate")) + // app.Router.Handler("GET", "/debug/pprof/block", pprof.Handler("block")) +} diff --git a/styles/widgets.scarlet b/styles/widgets.scarlet index 43d6541a..33940d6b 100644 --- a/styles/widgets.scarlet +++ b/styles/widgets.scarlet @@ -38,4 +38,5 @@ width 100% .widget-title - // \ No newline at end of file + // We need !important here to overwrite the h3:first-child rule + margin 1rem 0 !important \ No newline at end of file