Re:Why is D's garbage collection slower than GO's?
by zozbot234 on Saturday October 29, 2022 @06:33AM
(#33382759)
> With Rust and C++ (don't know about Swift), you s
still have to spend a lot of time thinking about memory.
You don't think about memory, you just think about how to ensure that you're always referencing live objects. And you need that kind of thinking anyway to deal with non-memory resources, where a GC won't help you at all.
Re:Why is D's garbage collection slower than GO's?
by tptacek on Saturday October 29, 2022 @03:21PM
(#33387164)
"You can't garbage collect file descriptors" is a very weak argument.
Re:Why is D's garbage collection slower than GO's?
by tjoff on Saturday October 29, 2022 @09:14AM
(#33383770)
My argument is that you always need to think about memory - even in GC languages. Being able to not think about memory is not a feature, it is a problem.
Re:Why is D's garbage collection slower than GO's?
by xigoi on Saturday October 29, 2022 @09:53AM
(#33384055)
Why? It's a low-level implementation detail. Should you also always think about registers and jumps?
Re:Why is D's garbage collection slower than GO's?
by tjoff on Saturday October 29, 2022 @02:04PM
(#33386483)
It is absolute not a low level detail, it is a huge part of your application and cannot be ignored.
Re:Why is D's garbage collection slower than GO's?
by xigoi on Saturday October 29, 2022 @02:16PM
(#33386589)
Interesting, I've made many programs without caring about memory management and they worked just fine.
Re:Why is D's garbage collection slower than GO's?
by lawn on Saturday October 29, 2022 @03:50PM
(#33387404)
It completely depends on what application you're creating if it can be ignored or not.
Re:Why is D's garbage collection slower than GO's?
by germandiago on Sunday October 30, 2022 @02:46PM
(#33397336)
You can just ignore it all almost as long as you stick to RAII and keep customizing allocators where you need. It is quite reasonable bc you can start to code fast and later imprpve performance in the allocation patterns.
There are other ways such as customozong new/delete.
Re:Why is D's garbage collection slower than GO's?
by xigoi on Sunday October 30, 2022 @02:55PM
(#33397435)
Custom allocators definitely count as thinking about memory. Possibly also RAII.
Re:Why is D's garbage collection slower than GO's?
by germandiago on Monday October 31, 2022 @05:00PM
(#33413052)
True. But pauses due to a GC also counts as thinking about memory...
Depends on your situation what you can or cannot do/afford.
With Rust and C++ (don't know about Swift), you still have to spend a lot of time thinking about memory.