Skip to content

Commit

Permalink
test: add benchmark tests for addAll
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Apr 22, 2024
1 parent d548773 commit 76b025d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/benchmarks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Future<void> 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);
});
Expand All @@ -119,6 +123,12 @@ Future<void> 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);
});
Expand Down

0 comments on commit 76b025d

Please sign in to comment.