diff options
| author | blake2-ppc <blake2-ppc> | 2013-07-21 21:05:48 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-07-21 21:05:48 +0200 |
| commit | bfa9b43b711c4d5db78d46cb70a6f8951b177a8f (patch) | |
| tree | 6958c440d5f26549b56999702bdc33cc29818f35 | |
| parent | b71c3d250f23eb15829229e69d69fa7df1d0dfe3 (diff) | |
| download | rust-bfa9b43b711c4d5db78d46cb70a6f8951b177a8f.tar.gz rust-bfa9b43b711c4d5db78d46cb70a6f8951b177a8f.zip | |
dlist: Add bench test for rotate_to_{front, back}
| -rw-r--r-- | src/libextra/dlist.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 189f20c9740..77c67387d95 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -1039,6 +1039,25 @@ mod tests { } } + #[bench] + fn bench_rotate_to_front(b: &mut test::BenchHarness) { + let mut m = DList::new::<int>(); + m.push_front(0); + m.push_front(1); + do b.iter { + m.rotate_to_front(); + } + } + + #[bench] + fn bench_rotate_to_back(b: &mut test::BenchHarness) { + let mut m = DList::new::<int>(); + m.push_front(0); + m.push_front(1); + do b.iter { + m.rotate_to_back(); + } + } #[bench] fn bench_iter(b: &mut test::BenchHarness) { |
