DEV Community

Discussion on: Why is artificial intelligence driven by Python and not C++?

Collapse
neokeats profile image
neokeats

« synchronous memory deallocation for more deterministic performance characteristics and memory profiles when compared to asynchronous GC approaches like those applied in Java, .Net, and GoLang. »

It’s not that obvious.
GC can be more performant because it’s not up to the dev to decide when the desallocation should happen.
It’s the role of the GC to decide if the system don’t have better tasks to do and deallocate memory at the right time by doing it for all unreferenced data in one go.
Of course in theory you can be as efficient about as a program but in the context of others program run at the time as yours, it’s less than obvious. You’ll most likely slow the machine by running memory desallocation while there is largely enough memory left etc...