favourites = ActivityPub.fetch_favourites(user)
- output_relationships =
- !!Pleroma.Config.get([:extensions, :output_relationships_in_statuses_by_default])
-
Benchee.run(
%{
"Rendering home timeline" => fn ->
StatusView.render("index.json", %{
activities: home_activities,
for: user,
- as: :activity,
- skip_relationships: !output_relationships
+ as: :activity
})
end,
"Rendering direct timeline" => fn ->
StatusView.render("index.json", %{
activities: direct_activities,
for: user,
- as: :activity,
- skip_relationships: !output_relationships
+ as: :activity
})
end,
"Rendering public timeline" => fn ->
StatusView.render("index.json", %{
activities: public_activities,
for: user,
- as: :activity,
- skip_relationships: !output_relationships
+ as: :activity
})
end,
"Rendering tag timeline" => fn ->
StatusView.render("index.json", %{
activities: tag_activities,
for: user,
- as: :activity,
- skip_relationships: !output_relationships
+ as: :activity
})
end,
"Rendering notifications" => fn ->
Pleroma.Web.MastodonAPI.NotificationView.render("index.json", %{
notifications: notifications,
- for: user,
- skip_relationships: !output_relationships
+ for: user
})
end,
"Rendering favourites timeline" => fn ->
StatusView.render("index.json", %{
activities: favourites,
for: user,
- as: :activity,
- skip_relationships: !output_relationships
+ as: :activity
})
end
},
"Public timeline with reply filtering - following" => fn ->
public_params
|> Map.put("reply_visibility", "following")
- |> Map.put("user", user)
+ |> Map.put("reply_filtering_user", user)
|> ActivityPub.fetch_public_activities()
end,
"Public timeline with reply filtering - self" => fn ->
public_params
|> Map.put("reply_visibility", "self")
- |> Map.put("user", user)
+ |> Map.put("reply_filtering_user", user)
|> ActivityPub.fetch_public_activities()
end
},
ActivityPub.fetch_activities(recipients, private_params)
end,
"Home timeline with reply filtering - following" => fn ->
- private_params = Map.put(private_params, "reply_visibility", "following")
+ private_params =
+ private_params
+ |> Map.put("reply_filtering_user", user)
+ |> Map.put("reply_visibility", "following")
ActivityPub.fetch_activities(recipients, private_params)
end,
"Home timeline with reply filtering - self" => fn ->
- private_params = Map.put(private_params, "reply_visibility", "self")
+ private_params =
+ private_params
+ |> Map.put("reply_filtering_user", user)
+ |> Map.put("reply_visibility", "self")
+
ActivityPub.fetch_activities(recipients, private_params)
end
},