4 ms·
You’re forcing the program to rediscover facts about itself at runtime. This is not free. That doesn’t mean a GCed lang is always slower than a lang where memo
by yoklov 8y ago
You’re forcing the program to rediscover facts about itself at runtime. This is not free.
That doesn’t mean a GCed lang is always slower than a lang where memory is managed manually. It means that the theoretically optimal implementation using GC has to do more work than the theoretically optimal implementation that manages its own memory.
In the case where the theoretically optimal implementation needs a GC, the unmanaged language could always implement that anyway, but that’s vanishingly rare — typically a GC gets its speedup by using pools, which are also available to unmanaged code.