4 ms·
This most likely has to do with their respective memory models. Rust will try and allocate most things on the stack unless an item is explicitly wrapped in a Bo
by squiguy7 9y ago
This most likely has to do with their respective memory models. Rust will try and allocate most things on the stack unless an item is explicitly wrapped in a Box. This isn't the only exception however. I can't speak to Java's model but I imagine it places more things on the heap.