std::vec: Add benchmark for .concat_vec and .connect_vec
This commit is contained in:
parent
67394f20eb
commit
5444f601dc
|
@ -3758,7 +3758,9 @@ mod tests {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod bench {
|
mod bench {
|
||||||
use extra::test::BenchHarness;
|
use extra::test::BenchHarness;
|
||||||
|
use iter::range;
|
||||||
use vec;
|
use vec;
|
||||||
|
use vec::VectorVector;
|
||||||
use option::*;
|
use option::*;
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
|
@ -3798,4 +3800,20 @@ mod bench {
|
||||||
xs + ys;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue