cargo test --release causes a stack overflow. Why doesn't cargo bench?
问题 In trying to write an optimized DSP algorithm, I was wondering about relative speed between stack allocation and heap allocation, and size limits of stack-allocated arrays. I realize there is a stack frame size limit, but I don't understand why the following runs, generating seemingly realistic benchmark results with cargo bench , but fails with a stack overflow when run with cargo test --release . #![feature(test)] extern crate test; #[cfg(test)] mod tests { use test::Bencher; #[bench] fn it