Skip to content

Commit

Permalink
test: add benchmarks for TreeSet.first/last
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Feb 23, 2024
1 parent 9c426c8 commit e21786a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/benchmarks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,18 @@ Future<void> main() async {
set.indexOf(e);
});
});

group('first', () {
var set = TreeSet()..addAll(data.values);
benchmark('of TreeSet', () {
set.first;
});
});

group('last', () {
var set = TreeSet()..addAll(data.values);
benchmark('of TreeSet', () {
set.last;
});
});
}

0 comments on commit e21786a

Please sign in to comment.