4 ms·
> Sadly, the two benchmarks are not equivalent, the Rust version loop over ints, the Java version loop over longs. I thought longs were 64 bit signed integers
by Gadiguibou 5y ago
> Sadly, the two benchmarks are not equivalent, the Rust version loop over ints, the Java version loop over longs.
I thought longs were 64 bit signed integers in Java, what's the difference with a u64 in Rust? Is it the signedness that affects performance?
> OptionalLong
Thanks for the info! I didn't know there were Optional primitive types in Java!
- deleted 5y ago[deleted]
- sushsjsuauahab 5y agoWell, it's not exactly a primitive (long) and instead it is an Object (Long), but I understand what you mean :)
- shawnz 5y agoOptionalLong is an object which optionally contains a value type (lowercase L) long. Optional<Long> is an object Optional which optionally contains an object Long.
- sushsjsuauahab 5y agoOh nice! I should have checked the docs or Intellij to see that it returns the primitive type ;)