Skip to content

Commit

Permalink
test: benchmark test TreeSet.elementAt
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Feb 22, 2024
1 parent 4196b6d commit 84dca02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/benchmarks_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:sortedmap/sortedmap.dart';
import 'package:sortedmap/src/treeset.dart';
import 'package:test/test.dart';

import 'util/benchmark.dart';
Expand Down Expand Up @@ -81,4 +82,11 @@ Future<void> main() async {
SortedMap(const Ordering.byValue()).addAll(view);
});
});

group('elementAt', () {
var set = TreeSet()..addAll(data.values);
benchmark('of TreeSet', () {
set.elementAt(n ~/ 3);
});
});
}

0 comments on commit 84dca02

Please sign in to comment.