I copied the initial/naive code presented and discovered that the compiler has clearly gained a few smarts in the last 3 years as it no longer bothers generating the fractal, unless you actually save to disk.
If you want to skip saving the image, you can use std::hint::black_box to give a hint to the compiler to be pessimistic:
let img = std::hint::black_box(algo(w, h));
For AVX instructions, marshalling the data in and out of vectors is usually the biggest overhead. Similarly, if you use openCL,webGPU, webGL, or any other GPU-based language, the biggest performance overhead is generally transferring data down to and back from the GPU.
So when I see "...... in rust" I cringe. Who the hell cares what a mandelbrot generator was written in?
Agree "...in pure rust" always reminds me of that scene in psych (Sean guster buddy detective show) where Sean is trying to guess a trivia question at local bistro for free coffee and muffins when he's beat by a better trivia guy ... the scene ends with the bester winning but he declines taking prize and says nah, I was stopping in to recycle and proceeds to plop a plastic bottle in the recycle bin. He walks out smarter, so good he needs no free stuff, and he's a recycler too! It's a kind of uppiness nobody likes.
It's about looking into optimizing the performance of and doing SIMD+parallelism implementations when using Rust. It is not about the resulting Mandelbrot generator itself being attractive because of the language it is written in.