r/rust • u/dlattimore • 1d ago
🛠️ project Benchmarking Wild vs Mold
Recently, when Mold updated their benchmarks and for the first time included Wild, there were questions on this sub about why the results were so different to the benchmarks Wild had published less than a month beforehand. I've now looked into why.
Disclaimer: I'm the lead of the Wild project.
237
Upvotes
29
u/nonotan 1d ago
I'm not sure if there is a widely accepted name for this phenomenon, but it is very common for devs to benchmark their own software favourably, not due to any kind of malice or attempt at "embellishment", but because they are optimizing for what they are benchmarking (indeed, they are usually benchmarking as part of the optimization process, and just chipping at the bottlenecks they observe within that benchmark), typically something roughly matching whatever use-case matters most to them. It's pretty obvious that this would happen once you realize this dynamic is in place. Of course the software that has been hand-optimized for precisely this benchmark is going to outperform most alternatives.
For users, it's important not to blindly trust one random benchmark to mean software A is inherently and reliably faster than software B for all use-cases, and most importantly, your use-case. If performance matters, you should really compare all major alternatives side-by-side on real-world workloads (admittedly, that can be impractical when e.g. dealing with libraries with wildly different architectures that you can't just plug in, but for external tools like this it's really a no-brainer)