std::vec: Add benchmark for .concat_vec and .connect_vec

This commit is contained in:
blake2-ppc 2013-09-28 04:53:20 +02:00
parent 67394f20eb
commit 5444f601dc

View File

@ -3758,7 +3758,9 @@ mod tests {
#[cfg(test)]
mod bench {
use extra::test::BenchHarness;
use iter::range;
use vec;
use vec::VectorVector;
use option::*;
#[bench]
@ -3798,4 +3800,20 @@ mod bench {
xs + ys;
}
}
#[bench]
fn concat(bh: &mut BenchHarness) {
let xss: &[~[uint]] = vec::from_fn(100, |i| range(0, i).collect());
do bh.iter {
xss.concat_vec();
}
}
#[bench]
fn connect(bh: &mut BenchHarness) {
let xss: &[~[uint]] = vec::from_fn(100, |i| range(0, i).collect());
do bh.iter {
xss.connect_vec(&0);
}
}
}