News for hackers. Stuff that matters.
Re:Defining interfaces in C++ with ‘concepts’ (C++20) by perfmode on Wednesday April 19, 2023 @03:17AM (#35625277)
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.

There are no comments on this comment yet.