Comment

Comment by midland_trucker

> In Go, I found that using an interface was not free: it can make the code slower. In C++, if you implement the following type and call count on it, you find that optimizing compilers are able to just figure out that they need to return the size of the inner vector.

I'm surprised at this, do Go interfaces really introduce much overhead? Of course this depends on the level of performance you care about but surely, being a statically typed language, lots of the same optimisations are available.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton