Add benchmarks

This commit is contained in:
Mayel de Borniol 2022-03-10 21:16:29 +13:00
parent 665bc6e61e
commit a3eccb231d
2 changed files with 20 additions and 1 deletions

2
.gitignore vendored
View file

@ -74,7 +74,7 @@ priv/localisation/*
.local/state/
docs/exdoc
bonfire.code-workspace
benchmarks/
benchmarks/output
# we use pnpm, so ignore others
assets/package-lock.json

19
benchmarks/feeds.ex Normal file
View file

@ -0,0 +1,19 @@
Benchee.run(
%{
"feed with boundaries" => fn -> Bonfire.Social.FeedActivities.feed(:local) end,
"feed without boundaries" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true) end,
"feed with minimal join/preloads with boundaries" => fn -> Bonfire.Social.FeedActivities.feed(:local, preloads: :minimum) end,
"feed with minimal join/preloads without boundaries" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true, preloads: :minimum) end,
# "AP:shared_outbox" => fn -> ActivityPubWeb.ObjectView.render("outbox.json", %{outbox: :shared_outbox}) end
},
parallel: 1,
warmup: 2,
time: 5,
memory_time: 2,
reduction_time: 2,
profile_after: true,
formatters: [
Benchee.Formatters.HTML,
Benchee.Formatters.Console
]
)