| ▲ | sreekanth850 11 hours ago |
| Rust is more close to metal. No GC |
|
| ▲ | aka-rider 5 hours ago | parent | next [-] |
| GC doesn’t affect performance (at least visibly), memory allocations on critical paths do. Moreover, Rust ARC may cause memory fragmentation and perform worse than a GC. Writing Rust, Zig, or Go, you would still control memory manually, where it matters. |
| |
| ▲ | dwattttt 4 hours ago | parent | next [-] | | It does have an impact. Discord blogged about unavoidable GC delays in go that occurred because go needed to traverse live memory, their only option (in go) for reducing that pause was to reduce the size of their data set. | |
| ▲ | sreekanth850 4 hours ago | parent | prev [-] | | https://discord.com/blog/why-discord-is-switching-from-go-to... GC absolutely has performance costs, even with minimal allocations, because tracing collectors must scan live objects. This is exactly what this post says. Don't know if its really improved over time in real world cases. |
|
|
| ▲ | pebal 8 hours ago | parent | prev [-] |
| There is no connection. Rust has ARC which performs worse than the tracing GC. |
| |
| ▲ | saagarjha 5 hours ago | parent [-] | | Than Go's GC? I think that is fairly unlikely in most cases. | | |
| ▲ | pebal 5 hours ago | parent [-] | | It depends on the workload. ARC can be more expensive than tracing GC, especially with heavily shared objects. But my main point was that the presence of a GC has nothing to do with how close a language is to the metal. Memory management strategy and low-level capabilities are two separate things. | | |
| ▲ | sreekanth850 4 hours ago | parent [-] | | I gave two separate reasons. Rust provides explicit control over memory allocation and management, and it has no garbage collector. | | |
| ▲ | pebal 2 hours ago | parent [-] | | Rust could just as well have an optional tracing GC for shared ownership instead of ARC, potentially improving performance rather than reducing it. Having a GC doesn't inherently make a language slower. | | |
| ▲ | josephg an hour ago | parent [-] | | > a GC doesn't inherently make a language slower. Yeah but let's be honest; GC languages (Go, Java, C#) usually are slower than systems languages. Systems languages just give you more, low level control over the computer from within your program. You can use that control to improve performance. Eg, you can control data locality, memory access patterns, the emitted assembler, and way more stuff. Of course you're right - if you misuse arc, you can make your program slow. So don't misuse arc then. Rust gives you lots of options for structuring memory. If you choose badly, that's on you. |
|
|
|
|
|