From 76b025d2569830ed92ac92a7b40aef8fa1a691d6 Mon Sep 17 00:00:00 2001 From: rikbellens Date: Mon, 22 Apr 2024 21:03:12 +0200 Subject: [PATCH] test: add benchmark tests for addAll --- test/benchmarks_test.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/benchmarks_test.dart b/test/benchmarks_test.dart index 6c5dd6b..02309d2 100644 --- a/test/benchmarks_test.dart +++ b/test/benchmarks_test.dart @@ -111,6 +111,10 @@ Future main() async { SortedMap(const Ordering.byValue()).addAll(data); }); + benchmark('to empty SortedMap, ordered by key', () async { + SortedMap(const Ordering.byKey()).addAll(data); + }); + benchmark('to empty SortedMap from SortedMap', () async { SortedMap(const Ordering.byValue()).addAll(map); }); @@ -119,6 +123,12 @@ Future main() async { SortedMap(const Ordering.byValue()).addAll(view); }); + benchmark('to empty FilteredMap', () async { + SortedMap(const Ordering.byValue()) + .filteredMap(start: Pair.min(), end: Pair.max(), limit: n ~/ 3) + .addAll(data); + }); + benchmark('to empty TreeSet', () async { TreeSet().addAll(values); });