提交 5444f601 编写于 作者: B blake2-ppc

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

上级 67394f20
......@@ -3758,7 +3758,9 @@ fn test_shrink_to_fit() {
#[cfg(test)]
mod bench {
use extra::test::BenchHarness;
use iter::range;
use vec;
use vec::VectorVector;
use option::*;
#[bench]
......@@ -3798,4 +3800,20 @@ fn add(b: &mut BenchHarness) {
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);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册