▲ | vlovich123 4 days ago | |
But the perf is not reliable. If you want latency and throughput, idiomatic Rust will give you better properties. Interestingly even will Go for some reason has better latency guarantees I believe even though it’s GC is worse than Java. | ||
▲ | gf000 3 days ago | parent | next [-] | |
There is not much point talking about throughput and latency in the abstract - they are very often opposing goals, you can make one better at the expense of the other. Go's GC is tuned more for latency at the expense of throughput (not sure if it still applies, but Go was quite literally stopping the "business" mutator threads when utilisation got higher to be able to keep up with the load - Java's default GC is tuned for a more balanced approach, but it can deliver it at very high congestion rates as well. Plus it has a low-latency focused GC which has much better latency guarantees, and it trades off some throughput in a consistent manner, so you can choose what fits best). The reason it might sometimes be more efficient than Java is simply value types - it doesn't create as much garbage, so doesn't need as good a GC in certain settings. Rust code can indeed be better at both metrics for a particular application, but it is not automatically true, e.g. if the requirements have funny lifetimes and you put a bunch of ARC's, then you might actually end up worse than a modern tracing GC could do. Also, future changes to the lifetimes may be more expensive (even though the compiler will guide you, you still have to make a lot of recursive changes all across the codebase, even if it might be a local change only in, say, Java), so for often changing requirements like most business software, it may not be the best choice (even though I absolutely love Rust). | ||
▲ | jghn 4 days ago | parent | prev | next [-] | |
This presupposes the use case is such that this even matters. Obviously that is the case sometimes, but in the vast majority of cases it is not. | ||
▲ | buckle8017 3 days ago | parent | prev [-] | |
For many applications deferred garbage collection is acceptable. Worse latency every ten minutes tends to be fine. |