use stalloc::{AllocChain, SyncStalloc};
use std::{alloc::System, hint::black_box, time::Instant};
#[global_allocator]
static GLOBAL: AllocChain<SyncStalloc<1024, 8>, System> = SyncStalloc::new().chain(&System);
fn main() {
let start = Instant::now();
let mut big_strings = vec![];
for i in 0..100_000_000 {
black_box(String::from("hello!"));
if i % 10000 == 0 {
big_strings.push("x".repeat(100_000));
}
}
for s in big_strings {
black_box(s);
}
println!("Elapsed: {}ms", start.elapsed().as_millis());
}