1use stalloc::{AllocChain, SyncStalloc};
2
3use std::{alloc::System, hint::black_box, time::Instant};
4
5#[global_allocator]
9static GLOBAL: AllocChain<SyncStalloc<1024, 8>, System> = SyncStalloc::new().chain(&System);
10
11fn main() {
12 let start = Instant::now();
13
14 let mut big_strings = vec![];
15
16 for i in 0..100_000_000 {
18 black_box(String::from("hello!"));
19
20 if i % 10000 == 0 {
22 big_strings.push("x".repeat(100_000));
23 }
24 }
25
26 for s in big_strings {
27 black_box(s);
28 }
29
30 println!("Elapsed: {}ms", start.elapsed().as_millis());
31}