Hacker News new | ask | show | jobs
by perfmode 1157 days 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.