| Index: pkg/kernel/test/uint31_pair_map_bench.dart
|
| diff --git a/pkg/kernel/test/uint31_pair_map_bench.dart b/pkg/kernel/test/uint31_pair_map_bench.dart
|
| deleted file mode 100644
|
| index 9f732a375dc69adf087dfbca3a69eb99df1b0b7a..0000000000000000000000000000000000000000
|
| --- a/pkg/kernel/test/uint31_pair_map_bench.dart
|
| +++ /dev/null
|
| @@ -1,64 +0,0 @@
|
| -import 'package:kernel/type_propagation/canonicalizer.dart';
|
| -
|
| -main() {
|
| - Stopwatch watch = new Stopwatch()..start();
|
| -
|
| - const int lowBiasKeys = 100;
|
| - const int highBiasKeys = 10000;
|
| - const int noBiasKeys = 1000;
|
| -
|
| - Uint31PairMap map;
|
| -
|
| - // Warm up.
|
| - map = new Uint31PairMap();
|
| - for (int i = 0; i < noBiasKeys; ++i) {
|
| - for (int j = 0; j < noBiasKeys; ++j) {
|
| - map.lookup(i, j);
|
| - map.put(i + j);
|
| - }
|
| - }
|
| -
|
| - // Even distributed tuple components.
|
| - watch.reset();
|
| - map = new Uint31PairMap();
|
| - for (int i = 0; i < noBiasKeys; ++i) {
|
| - for (int j = 0; j < noBiasKeys; ++j) {
|
| - map.lookup(i, j);
|
| - map.put(i + j);
|
| - }
|
| - }
|
| - int noBiasTime = watch.elapsedMicroseconds;
|
| -
|
| - // Left-bias: more unique keys in the first component.
|
| - watch.reset();
|
| - map = new Uint31PairMap();
|
| - for (int i = 0; i < highBiasKeys; ++i) {
|
| - for (int j = 0; j < lowBiasKeys; ++j) {
|
| - map.lookup(i, j);
|
| - map.put(i + j);
|
| - }
|
| - }
|
| - int leftBiasTime = watch.elapsedMicroseconds;
|
| -
|
| - // Right-bias: more unique keys in the second component.
|
| - watch.reset();
|
| - map = new Uint31PairMap();
|
| - for (int i = 0; i < lowBiasKeys; ++i) {
|
| - for (int j = 0; j < highBiasKeys; ++j) {
|
| - map.lookup(i, j);
|
| - map.put(i + j);
|
| - }
|
| - }
|
| - int rightBiasTime = watch.elapsedMicroseconds;
|
| -
|
| - print('''
|
| -bias.none: ${formatTime(noBiasTime)}
|
| -bias.left: ${formatTime(leftBiasTime)}
|
| -bias.right: ${formatTime(rightBiasTime)}
|
| -''');
|
| -}
|
| -
|
| -String formatTime(int microseconds) {
|
| - double seconds = microseconds / 1000000.0;
|
| - return '$seconds s';
|
| -}
|
|
|