3 ms·
There is overhead in interface indirection because the Go runtime needs to perform dynamic dispatch to determine which method to call at runtime. C++ can optim
by perfmode 3y ago
There is overhead in interface indirection because the Go runtime needs to perform dynamic dispatch to determine which method to call at runtime.
C++ can optimize interface indirection away because it supports static polymorphism, which allows the compiler to generate specialized code for each concrete type used with a generic interface, eliminating the need for dynamic dispatch.