I've wrote algorithm for converting u128 into base62, and testing it. It has two versions naive and hand optimized.
naive version have same performance in Zig and Rust:
Rust
bench_u128_to_base62_naive 1000000: 32.86Mib/s, 2153250.28/s
Zig
bench_u128_to_base62_naive 1000000: 34.05Mb/s, 2231504.73/s
But with optimized version something interesting happening (both release builds):
Rust
bench_u128_to_base62 1000000: 111.97Mb/s, 7338325.18/s
Zig
bench_u128_to_base62 1000000: 491.03Mb/s, 32179951.21/s
Zig code is 4x faster compared to Rust, how is it possible? Both using llvm, does Zig using some better defaults or something? How can I investigate, only looking at generated assembler?