mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 19:43:43 +00:00
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)]
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user