diff options
author | lain <lain@soykaf.club> | 2020-01-20 12:19:15 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-01-20 12:19:15 +0100 |
commit | 271afcd940b743b84fae2ee40245d1e0c53cc714 (patch) | |
tree | f9d1e48cbeed5ed79acac6c7705133508624936b /benchmarks/mix | |
parent | 167e9c45eccf5ddb89077c979b1d587318f78cc0 (diff) | |
download | pleroma-271afcd940b743b84fae2ee40245d1e0c53cc714.tar.gz |
Add benchmark of any/all tag options
Diffstat (limited to 'benchmarks/mix')
-rw-r--r-- | benchmarks/mix/tasks/pleroma/benchmarks/tags.ex | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/benchmarks/mix/tasks/pleroma/benchmarks/tags.ex b/benchmarks/mix/tasks/pleroma/benchmarks/tags.ex index 73796b5f9..fd1506907 100644 --- a/benchmarks/mix/tasks/pleroma/benchmarks/tags.ex +++ b/benchmarks/mix/tasks/pleroma/benchmarks/tags.ex @@ -33,6 +33,36 @@ defmodule Mix.Tasks.Pleroma.Benchmarks.Tags do Benchee.run( %{ + "Hashtag fetching, any" => fn tags -> + Pleroma.Web.MastodonAPI.TimelineController.hashtag_fetching( + %{ + "any" => tags + }, + user, + false + ) + end, + # Will always return zero results because no overlapping hashtags are generated. + "Hashtag fetching, all" => fn tags -> + Pleroma.Web.MastodonAPI.TimelineController.hashtag_fetching( + %{ + "all" => tags + }, + user, + false + ) + end + }, + inputs: + tags + |> Enum.map(fn {_, v} -> v end) + |> Enum.chunk_every(2) + |> Enum.map(fn tags -> {"For #{inspect(tags)}", tags} end), + time: 5 + ) + + Benchee.run( + %{ "Hashtag fetching" => fn tag -> Pleroma.Web.MastodonAPI.TimelineController.hashtag_fetching( %{ |