// I really don't like the fact that '#!' is a syntax thing, often as the first bytes of a file. #![feature(test)] extern crate test; // 'extern crate' seems to be required for this scenario: https://github.com/rust-lang/rust/issues/57288 use test::{Bencher, black_box}; use std::time::Instant; use stacked::{self, SVec, SVec32}; #[bench] fn vec1(b:&mut Bencher) { b.iter(|| { for _ in 1..100 { let mut v = Vec::::with_capacity(32); let cap = v.capacity(); while v.len()::new(); let start = Instant::now(); for _ in 1..10_000_000 { v.clear(); let cap = v.cap(); while v.len()