3 ms·
Rust doesn't have types named 'int' and 'long' out of the box. It does have types named e.g. i32, i64, u32 and u64. Because the function get_int() takes a u64,
by tialaramex 5y ago
Rust doesn't have types named 'int' and 'long' out of the box. It does have types named e.g. i32, i64, u32 and u64.
Because the function get_int() takes a u64, Rust will conclude that the variable i must be a u64 so as to fit in that parameter.
It seems to me that "Java is bad at 64-bit integers" is also useful information but not pertinent to this benchmark, unless you assume it's trying to compare Java to Rust, at which of course Java will be far slower - but I don't think that's the point of the benchmark at all.