From 6a60fe1860604422727ae7d0d9a35498b252e4b1 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 9 Apr 2026 07:05:06 +0100 Subject: [PATCH] Add benchmark for collection count functions --- bench/collection.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bench/collection.exs diff --git a/bench/collection.exs b/bench/collection.exs new file mode 100644 index 00000000..2c6d7fa8 --- /dev/null +++ b/bench/collection.exs @@ -0,0 +1,14 @@ +alias MusicLibrary.Collection + +Logger.configure(level: :error) + +Benchee.run( + %{ + "count_records_by_artist(limit: 20)" => fn -> Collection.count_records_by_artist(limit: 20) end, + "count_records_by_genre(limit: 20)" => fn -> Collection.count_records_by_genre(limit: 20) end, + "count_records_by_release_year(limit: 20)" => fn -> Collection.count_records_by_release_year(limit: 20) end + }, + warmup: 2, + time: 5, + memory_time: 2 +)