Mayel de Borniol 2022-06-07 20:11:04 +12:00
parent 13a34faa3d
commit c31db70ed0
3 changed files with 22 additions and 18 deletions

View file

@ -1,12 +1,14 @@
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,
"feed with boundaries & minimal join/preloads" => fn -> Bonfire.Social.FeedActivities.feed(:local, preloads: :with_object) end,
"feed without boundaries & minimal join/preloads" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true, preloads: :with_object) end,
"feed with boundaries & cached preloads" => fn -> Bonfire.Social.FeedActivities.feed(:local) |> Bonfire.Social.Feeds.LiveHandler.preloads() end,
"feed without boundaries & cached preloads" => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true) |> Bonfire.Social.Feeds.LiveHandler.preloads() end,
"feed with boundaries & full join/preloads" => fn -> Bonfire.Social.FeedActivities.feed(:local, preloads: :feed) end,
"feed without boundaries & with full join/preloads " => fn -> Bonfire.Social.FeedActivities.feed(:local, skip_boundary_check: true, preloads: :feed) end,
# "AP:shared_outbox" => fn -> ActivityPubWeb.ObjectView.render("outbox.json", %{outbox: :shared_outbox}) end
},
parallel: 1,
parallel: 10,
warmup: 2,
time: 5,
memory_time: 2,

View file

@ -48,20 +48,22 @@ defmodule Bonfire.Application do
Bonfire.Federate.ActivityPub.FederationModules
]
@default_cache_ttl 1_000 * 60 * 60 * 6 # 6 hours
# Stuff that depends on all the above
@apps_after [
@endpoint_module, # Web app
{Oban, Application.fetch_env!(:bonfire, Oban)}, # Job Queue
%{
id: :cachex_settings,
id: :bonfire_cache,
start: {Cachex, :start_link, [
:bonfire_cache, [
expiration: Cachex.Spec.expiration(
default: 25_000,
interval: 1000
),
limit: 2500 # increase for instances with more users (at least num. of users*2+1)
]]}},
:bonfire_cache, [
expiration: Cachex.Spec.expiration(
default: @default_cache_ttl,
interval: 1000
),
limit: 5000 # increase for instances with more users (at least num. of users*2+1)
]]}}
]
def applications(:test, _any) do

View file

@ -33,19 +33,19 @@
"bonfire_files": {:git, "https://github.com/bonfire-networks/bonfire_files", "095ad6c1dc3f301b59825091713bb33f7c15d92b", [branch: "main"]},
"bonfire_geolocate": {:git, "https://github.com/bonfire-networks/bonfire_geolocate", "4092df39a6b91e2fca6bc7bec9deac50c4621733", [branch: "main"]},
"bonfire_invite_links": {:git, "https://github.com/bonfire-networks/bonfire_invite_links", "18cf954c55e271d94ac9b02db528468b25c5fb3e", [branch: "main"]},
"bonfire_mailer": {:git, "https://github.com/bonfire-networks/bonfire_mailer", "432c4cb16601b7be5835b95791314660836c4e73", [branch: "main"]},
"bonfire_mailer": {:git, "https://github.com/bonfire-networks/bonfire_mailer", "0d95c84465edb68637e0866ecbe8bc302a671939", [branch: "main"]},
"bonfire_me": {:git, "https://github.com/bonfire-networks/bonfire_me", "2baf4355517fa2220bdc98e7c13449b0eb00cfd1", [branch: "main"]},
"bonfire_open_id": {:git, "https://github.com/bonfire-networks/bonfire_open_id", "acfba1cd060b8307c2def9bcb08ecb76dd9f4aaf", [branch: "main"]},
"bonfire_quantify": {:git, "https://github.com/bonfire-networks/bonfire_quantify", "bbfa8bac5d16ebf9a58b0e98ebd60f4423e8e570", [branch: "main"]},
"bonfire_search": {:git, "https://github.com/bonfire-networks/bonfire_search", "d01ab0c1ecfe23ef70a2b4694cbf59172b63185e", [branch: "main"]},
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "d364d10ded81ef5067b6ae4d1ef1bc250a4358ac", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "b98f063f530f149b7bd5db4dfa37c663fbfb31cc", [branch: "main"]},
"bonfire_ui_common": {:git, "https://github.com/bonfire-networks/bonfire_ui_common", "006ec9edd6bfcb7111debe8ce2ca0e2aa5e9fa20", [branch: "main"]},
"bonfire_ui_common": {:git, "https://github.com/bonfire-networks/bonfire_ui_common", "17fa8f74c5e04dd22d557348f5be56052572cc2f", [branch: "main"]},
"bonfire_ui_coordination": {:git, "https://github.com/bonfire-networks/bonfire_ui_coordination", "40b24b68b542c31a0c99be2650b8148c5ad01161", [branch: "main"]},
"bonfire_ui_kanban": {:git, "https://github.com/bonfire-networks/bonfire_ui_kanban", "69f42c5c38e5d63e4e60b4ef8d0191224c297b14", [branch: "main"]},
"bonfire_ui_me": {:git, "https://github.com/bonfire-networks/bonfire_ui_me", "4a83c1b531d54f0a9053691552ef69d35e0bf142", [branch: "main"]},
"bonfire_ui_me": {:git, "https://github.com/bonfire-networks/bonfire_ui_me", "554b22d68dfe98049a96395349dd807c52b99934", [branch: "main"]},
"bonfire_ui_reflow": {:git, "https://github.com/bonfire-networks/bonfire_ui_reflow", "befd9ccb3b28b1e46e4a485deb493a041fde181b", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "98575d0481d5130e33c5660a512d95047860cffb", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "e5a88d7151eedb84329aba3ae139ba5aa9ad7a08", [branch: "main"]},
"bonfire_ui_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_ui_valueflows", "1b767e92009a9d82f5f258c9f8b415a8ee0c73c8", [branch: "main"]},
"bonfire_upcycle": {:git, "https://gitlab.com/bonfire-networks/bonfire_upcycle", "bb3fb7f2ad8664290913cf0d76f877b7aac2f269", [branch: "master"]},
"bonfire_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_valueflows", "83d9148c94f876e946f6deba1fc67cfbbda6fd72", [branch: "main"]},
@ -167,7 +167,7 @@
"plug": {:hex, :plug, "1.13.6", "187beb6b67c6cec50503e940f0434ea4692b19384d47e5fdfd701e93cadb4cc2", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02b9c6b9955bce92c829f31d6284bf53c591ca63c4fb9ff81dfd0418667a34ff"},
"plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"pointers": {:git, "https://github.com/bonfire-networks/pointers", "c42d227bb3a9e53e390257e3206013c6d1975691", [branch: "main"]},
"pointers": {:git, "https://github.com/bonfire-networks/pointers", "d0c504e56aa26772ea16bb73a5e046d588eca18b", [branch: "main"]},
"pointers_ulid": {:git, "https://github.com/bonfire-networks/pointers_ulid", "3bb0637fcd26cb1555c1ed609e69c3a5e4b05512", [branch: "main"]},
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"postgrex": {:hex, :postgrex, "0.16.3", "fac79a81a9a234b11c44235a4494d8565303fa4b9147acf57e48978a074971db", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "aeaae1d2d1322da4e5fe90d241b0a564ce03a3add09d7270fb85362166194590"},