I added small changes to Rust code to make it little bit more 1:1 with Zig version.
Changes:
Device variable is changed as const. It should now act similar to comptime Device.
Added RUSTFLAGS='-Ctarget-cpu=native' environment variable to dockerfile. Unlike Zig's -O ReleaseFast flag, Rust compiler doesn't use wide CPU registers by default, you have to specify CPU target in general.
I also tested both versions with bombardier. Differences are limited, and I don't think it would change the benchmark results too much, but :: it's something ::
I added small changes to Rust code to make it little bit more 1:1 with Zig version.
Changes:
comptime Device
.-O ReleaseFast
flag, Rust compiler doesn't use wide CPU registers by default, you have to specify CPU target in general.Example assembly comparisons, if anyone interested in; Rust - https://godbolt.org/z/9aG61z1a8 Zig - https://godbolt.org/z/4nYTEEY1j
I also tested both versions with bombardier. Differences are limited, and I don't think it would change the benchmark results too much, but :: it's something ::
Current main HEAD:
PR version: