3 ms·
What overhead is there at runtime?
What overhead is there at runtime?
Casting a value to an interface forces it to be allocated on the heap.
Interfaces are both allocations and function-call indirection, and I think they also always move their data to the heap.
Which is almost always trivial except when it isn't.