[HN Gopher] Rust vs Zig Benchmarks
___________________________________________________________________
Rust vs Zig Benchmarks
Author : alonp99
Score : 29 points
Date : 2023-06-17 21:48 UTC (1 hours ago)
(HTM) web link (programming-language-benchmarks.vercel.app)
(TXT) w3m dump (programming-language-benchmarks.vercel.app)
| josephg wrote:
| Tldr; they're about even. Which is what I'd expect from the fact
| they both use llvm to produce similar binaries.
|
| As I see it, performance wise Rust has one advantage and one
| disadvantage compared to zig. Its advantage is that rust can add
| the equivalent of C's noalias all over the place because of the
| unique mut reference rule. This can help the optimizer. And the
| drawback of rust is that all array accesses are bounds checked.
| (Well, at least in safe rust). But thanks to prediction
| intrinsics, the slow down from this is much less than I thought
| it would be from looking at the assembly. (Bounds checks do bloat
| the binary size though).
|
| So rust and zig trading blows benchmark to benchmark is about
| what I would expect to happen. And that's what it looks like
| here.
| dleslie wrote:
| Which is amazing, because Rust comes with more safety
| guarantees.
| EscapeFromNY wrote:
| Didn't these benchmarks used to have box plots for every
| comparison? Or am I thinking of another site?
| cristoperb wrote:
| You're probably thinking of this one: https://benchmarksgame-
| team.pages.debian.net/benchmarksgame/...
| silisili wrote:
| Happy for this new one. The one you linked was/is maintained
| by someone with rather strong opinions that exclude things
| and may skew results.
___________________________________________________________________
(page generated 2023-06-17 23:00 UTC)