|
|
|
|
|
by pornel
1922 days ago
|
|
I don't disagree that memory access is nowadays critical for speed, but I haven't found Rust standing in the way of optimizing it. As I've pointed out in the article, Rust does give you precise control over memory layout. Heap allocations are explicit and optional. In safe code. You don't even need to avoid any nice features (e.g. closures and iterators can be entirely on stack, no allocations needed). Move semantics enables `memcpy`ing objects anywhere, so they don't have a permanent address, and don't need to be allocated individually. In this regard Rust is different from e.g. Swift and Go, which claim to have C-like speed, but will autobox objects for you. |
|